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

Add method to return hash of bank state #1142

Merged
merged 1 commit into from
Sep 7, 2018

Conversation

CriesofCarrots
Copy link
Contributor

Resolves #1130

src/bank.rs Outdated Show resolved Hide resolved
src/bank.rs Outdated
@@ -637,6 +638,14 @@ impl Bank {
false
}

pub fn hash_bank_state(&self) -> Hash {
Copy link
Contributor

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,
Copy link
Contributor

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.

Copy link
Contributor Author

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/bank.rs Show resolved Hide resolved
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)]
Copy link
Contributor

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.

@CriesofCarrots CriesofCarrots force-pushed the hash_bank branch 2 times, most recently from d0d4d48 to d35633e Compare September 7, 2018 19:59
@CriesofCarrots CriesofCarrots merged commit 5169c8d into solana-labs:master Sep 7, 2018
@CriesofCarrots CriesofCarrots deleted the hash_bank branch September 7, 2018 22:04
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