Skip to content

Commit 13a30a3

Browse files
committed
pallet-revive: make a try_upload_pvm_code/code_hash public
... to help with foundry-polkadot implementation for etch cheatcode Signed-off-by: Alexandru Gheorghe <[email protected]>
1 parent 2c25da9 commit 13a30a3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

substrate/frame/revive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,7 @@ impl<T: Config> Pallet<T> {
18511851
}
18521852

18531853
/// Uploads new code and returns the Vm binary contract blob and deposit amount collected.
1854-
fn try_upload_pvm_code(
1854+
pub fn try_upload_pvm_code(
18551855
origin: T::AccountId,
18561856
code: Vec<u8>,
18571857
storage_deposit_limit: BalanceOf<T>,

substrate/frame/revive/src/vm/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ impl<T: Config> ContractBlob<T> {
233233
}
234234
})
235235
}
236+
237+
/// Returns the code_hash of the contract blob.
238+
pub fn code_hash(&self) -> H256 {
239+
self.code_hash
240+
}
236241
}
237242

238243
impl<T: Config> CodeInfo<T> {

0 commit comments

Comments
 (0)