mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 11:38:01 +00:00
Implement contract_getStorage RPC API (#3944)
This commit is contained in:
@@ -664,6 +664,21 @@ impl_runtime_apis! {
|
||||
Err(_) => ContractExecResult::Error,
|
||||
}
|
||||
}
|
||||
|
||||
fn get_storage(
|
||||
address: AccountId,
|
||||
key: [u8; 32],
|
||||
) -> contracts_rpc_runtime_api::GetStorageResult {
|
||||
Contracts::get_storage(address, key).map_err(|rpc_err| {
|
||||
use contracts::GetStorageError;
|
||||
use contracts_rpc_runtime_api::{GetStorageError as RpcGetStorageError};
|
||||
/// Map the contract error into the RPC layer error.
|
||||
match rpc_err {
|
||||
GetStorageError::ContractDoesntExist => RpcGetStorageError::ContractDoesntExist,
|
||||
GetStorageError::IsTombstone => RpcGetStorageError::IsTombstone,
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl transaction_payment_rpc_runtime_api::TransactionPaymentApi<
|
||||
|
||||
Reference in New Issue
Block a user