From ea110efabd6e09017d7a757f20c1ad2baafd84ae Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 2 Mar 2019 09:46:19 -0800 Subject: [PATCH] Rename AdvertiseStorageLastId to AdvertiseStorageRecentBlockHash --- programs/native/storage/src/lib.rs | 4 ++-- programs/native/storage/tests/storage.rs | 2 +- sdk/src/storage_program.rs | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/programs/native/storage/src/lib.rs b/programs/native/storage/src/lib.rs index cd2084842f..7136e55044 100644 --- a/programs/native/storage/src/lib.rs +++ b/programs/native/storage/src/lib.rs @@ -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(); diff --git a/programs/native/storage/tests/storage.rs b/programs/native/storage/tests/storage.rs index 4629ab3acf..a203ea505d 100644 --- a/programs/native/storage/tests/storage.rs +++ b/programs/native/storage/tests/storage.rs @@ -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() diff --git a/sdk/src/storage_program.rs b/sdk/src/storage_program.rs index e6b2f50c19..7750720cc6 100644 --- a/sdk/src/storage_program.rs +++ b/sdk/src/storage_program.rs @@ -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>, pub previous_proofs: Vec>, @@ -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)