Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Homework0 #2

wants to merge 6 commits into from

Conversation

Jackliu-miaozi
Copy link
Owner

No description provided.

@Jackliu-miaozi
Copy link
Owner Author

Jackliu-miaozi commented Dec 13, 2023

Why did the GitHub Action check fail?

Copy link

@shamilsan shamilsan left a 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};

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.

Copy link
Owner Author

@Jackliu-miaozi Jackliu-miaozi Dec 18, 2023

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));

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?

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.

@shamilsan
Copy link

Why did the GitHub Action check fail?

At least you are to run cargo fmt. As I see, the first CI error is related to format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants