-
Notifications
You must be signed in to change notification settings - Fork 8
NDEV-1837 Remove syscall_stub #277
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
Conversation
…sts' into NDEV-1837_solana_compasibility
anton-lisanin
left a comment
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 remove lib/src/syscall_stubs.rs
| .await? | ||
| .value | ||
| .unwrap(); | ||
| let rent = Rent::from_account_info(&AccountInfo { |
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.
This can be simplified to
let rent = bincode::deserialize(&rent_account.data)
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.
Fixed
| }; | ||
|
|
||
| // TODO: is it correct to get rent from the account | ||
| let mut rent_account = rpc |
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 is correct
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.
Removed
| .get_account(&solana_sdk::sysvar::rent::id()) | ||
| .await? | ||
| .value | ||
| .unwrap(); |
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.
Check for error instead of unwarping
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.
Fixed
| } | ||
|
|
||
| fn rent(&self) -> &Rent { | ||
| unimplemented!(); |
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.
Why unimplemented!?
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.
This TestDatabase is used only for cargo tests and rent() method isn't required.
| } | ||
|
|
||
| #[cfg(target_os = "solana")] | ||
| macro_rules! log_msg { |
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.
What is the difference between debug_print and log_msg?
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.
debug_print doesn't show any line in program, log_msg is replacement for solana_program::msg macros.
|
Will be merged to 1.9.x as part of #281 |
log_data()andlog_msg()to work with our implementation instead ofsyscall_stabin emulation context