-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System SC mock #1100
System SC mock #1100
Conversation
40fd902
to
978d89d
Compare
Contract comparison - from 4aab4a9 to 27e617c
|
vm/Cargo.toml
Outdated
@@ -26,6 +26,8 @@ rand = "0.8.5" | |||
rand_seeder = "0.2.2" | |||
ed25519-dalek = "1.0.1" | |||
itertools = "0.10.3" | |||
bech32 = "0.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this dependency is needed.
Bech32 is more of a "front-end" thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
vm/src/tx_execution/system_sc.rs
Outdated
"issue" => issue(tx_context), | ||
"issueSemiFungible" => issue_semi_fungible(tx_context), | ||
"issueNonFungible" => issue_non_fungible(tx_context), | ||
"registerMetaESDT" => todo!(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace these todos with a more explicit panic message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added blanket fn
s for now with unimplemented!()
let ticker = tx_input.args[1].clone(); | ||
|
||
let mut new_token_identifiers = tx_cache.get_new_token_identifiers(); | ||
let token_identifier = if let Some(ti) = new_token_identifiers.pop_front() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might not be the first token identifier the one that has the right ticker.
We must iterate while extracting the ticker, then remove at that position.
This is also some duplicate code, which we should extract to a separate method in TxCache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
A system SC mock is required to run tests that involve issuing of new tokens.