-
Notifications
You must be signed in to change notification settings - Fork 48
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
completed smart contract section #54
base: master
Are you sure you want to change the base?
Conversation
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 make a PR to be merged into your repo (https://github.com/kenocathon/dapps-template-gear-academy/) instead of the template.
Please reread the homework rules: https://academy.gear.rs/getting-started/homework-rules
Note that the target branch for the PR should be
master
in your repository, not in the template one.
Also, please be sure your CI workflow passes before sending the 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.
Please use cargo fmt
before committing.
TmgAction::Age => { | ||
debug!("Tamagotchi: Age Requested"); | ||
// Directly reply with the date of birth, as TmgAction::Age does not carry data | ||
msg::reply(TmgEvent::Age(state.date_of_birth), 0) |
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.
Age should depend on the current block timestamp.
#[no_mangle] | ||
extern fn state() { | ||
// TODO: 7️⃣ Return the Tamagotchi state | ||
let tomagotchi = unsafe { |
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.
Typo:
let tomagotchi = unsafe { | |
let tamagotchi = unsafe { |
|
||
assert!(!get_name_result.main_failed(), "Name request failed"); | ||
|
||
let expected_tamagatchi = Log::builder() |
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.
Typo
let expected_tamagatchi = Log::builder() | |
let expected_tamagotchi = Log::builder() |
Finished the homework and uploaded program to the testnet blockchain. Recieved a new tomagatchi as expected.