-
Notifications
You must be signed in to change notification settings - Fork 79
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
Runtime: Add several new methods #1150
Conversation
runtime/src/runtime/mod.rs
Outdated
/// The gas still available for computation | ||
fn gas_available(&self) -> u64; | ||
|
||
/// The current tipset's timestamp, as UNIX seconds |
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.
Could you clarify whether "current" is the tipset that includes the message, or the subsequent one when the message is executed?
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!
runtime/src/runtime/mod.rs
Outdated
fn tipset_timestamp(&self) -> u64; | ||
|
||
/// The hash of on of the last 256 blocks | ||
fn tipset_cid(&self, epoch: i64) -> Option<Cid>; |
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 happens if epoch is more than 256 ago? Just None
? Kinda wierd we don't get error numbers here.
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 agree -- I think a Result would make more sense here. I've raised it here.
Also the comment on this is wrong (AFAIC tell) -- you can lookup Finality epochs. I'm going to update it.
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.
Thanks, yes I would expect FINALITY too
Extracted from
next
.This PR adds the following methods to the Runtime interface:
actor_balance
gas_available
tipset_timestamp
tipset_cid
hash
hash_64
recover_secp_public_key
Note: This isn't the most cohesive PR, sorry :')