-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add method to return hash of bank state #1142
Conversation
src/bank.rs
Outdated
@@ -637,6 +638,14 @@ impl Bank { | |||
false | |||
} | |||
|
|||
pub fn hash_bank_state(&self) -> Hash { |
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.
How about the name hash_internal_state()
? And add some documentation about its intended use.
src/bank.rs
Outdated
@@ -974,6 +996,15 @@ mod tests { | |||
(genesis.into_iter().chain(block), mint.pubkey()) | |||
} | |||
|
|||
fn create_sample_ledger_with_mint_and_keypairs( | |||
mint: Mint, |
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.
No need to move the Mint here. Borrow it, and then you don't need to return its Pubkey.
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.
Oh, duh. I toyed with this, but missed axing the Pubkey.
src/mint.rs
Outdated
@@ -7,7 +7,7 @@ use signature::{Keypair, KeypairUtil, Pubkey}; | |||
use transaction::Transaction; | |||
use untrusted::Input; | |||
|
|||
#[derive(Serialize, Deserialize, Debug)] | |||
#[derive(Serialize, Deserialize, Debug, Clone)] |
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 shouldn't need this.
d0d4d48
to
d35633e
Compare
d35633e
to
a867536
Compare
Resolves #1130