Rename AdvertiseStorageLastId to AdvertiseStorageRecentBlockHash

This commit is contained in:
Michael Vines 2019-03-02 09:46:19 -08:00 committed by Greg Fitzgerald
parent 0743f54dfe
commit ea110efabd
3 changed files with 9 additions and 9 deletions

View File

@ -83,7 +83,7 @@ fn entrypoint(
};
storage_account_state.proofs[segment_index].push(proof_info);
}
StorageProgram::AdvertiseStorageLastId { id, entry_height } => {
StorageProgram::AdvertiseStorageRecentBlockHash { hash, entry_height } => {
let original_segments = storage_account_state.entry_height / ENTRIES_PER_SEGMENT;
let segments = entry_height / ENTRIES_PER_SEGMENT;
debug!(
@ -95,7 +95,7 @@ fn entrypoint(
}
storage_account_state.entry_height = entry_height;
storage_account_state.id = id;
storage_account_state.hash = hash;
// move the proofs to previous_proofs
storage_account_state.previous_proofs = storage_account_state.proofs.clone();

View File

@ -30,7 +30,7 @@ fn get_storage_last_id(bank: &Bank, account: Pubkey) -> Hash {
let state = deserialize(&storage_system_account.userdata);
if let Ok(state) = state {
let state: storage_program::StorageProgramState = state;
return state.id;
return state.hash;
}
}
Hash::default()

View File

@ -32,7 +32,7 @@ pub struct ValidationInfo {
#[derive(Default, Debug, Serialize, Deserialize)]
pub struct StorageProgramState {
pub entry_height: u64,
pub id: Hash,
pub hash: Hash,
pub proofs: Vec<Vec<ProofInfo>>,
pub previous_proofs: Vec<Vec<ProofInfo>>,
@ -48,8 +48,8 @@ pub enum StorageProgram {
entry_height: u64,
signature: Signature,
},
AdvertiseStorageLastId {
id: Hash,
AdvertiseStorageRecentBlockHash {
hash: Hash,
entry_height: u64,
},
ClaimStorageReward {
@ -94,12 +94,12 @@ impl StorageTransaction {
pub fn new_advertise_recent_block_hash(
from_keypair: &Keypair,
storage_id: Hash,
storage_hash: Hash,
recent_block_hash: Hash,
entry_height: u64,
) -> Transaction {
let program = StorageProgram::AdvertiseStorageLastId {
id: storage_id,
let program = StorageProgram::AdvertiseStorageRecentBlockHash {
hash: storage_hash,
entry_height,
};
Transaction::new(from_keypair, &[], id(), &program, recent_block_hash, 0)