-
Notifications
You must be signed in to change notification settings - Fork 0
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
Homework0 #2
base: master
Are you sure you want to change the base?
Homework0 #2
Conversation
Why did the GitHub Action check fail? |
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.
Awesome! Please pay attention to the CI workflow. It should be green.
@@ -1,38 +1,43 @@ | |||
#![no_std] | |||
|
|||
use codec::{Decode, Encode}; | |||
use gmeta::Metadata; | |||
use gmeta::{Metadata,In,InOut,Out}; |
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.
Please, use cargo fmt
before PR.
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.
Got it.
Thank you. You are the first who taught me coding step by step.
assert!(result.contains(&log)); | ||
let _result = program.send(2, TmgAction::Age); | ||
// let log = Log::builder().dest(2).payload(TmgEvent::Age(sys.block_timestamp())); | ||
// assert!(result.contains(&log)); |
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.
You can use System::spend_blocks
to go forward and emulate the changed timestamp.
let payload = vec![1, 2, 3]; | ||
let _result = program.send(2, payload); | ||
// assert!(result.main_failed()); | ||
// Why the assert is panic? |
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 panics because the init()
function can't decode the payload as a UTF-8 string, I guess.
At least you are to run |
No description provided.