[pallet-revive] update generic runtime types (#5608)
fix #5574
- Use U256 instead of BalanceOf<T> and MomentOf<T> in Ext trait
- Enforce H256 for T::Hash
The Ext trait still depends on the associated type `T: Config`, we can
look into refactoring it even more later but even in the current state
it should not influence how the data is encoded / decoded between the
contract and the host
```
fn caller(&self) -> Origin<Self::T>;
-> only use to extract the address of the caller
fn account_id(&self) -> &AccountIdOf<Self::T>;
-> only used to expose the address or access the account_id internally
fn gas_meter(&self) -> &GasMeter<Self::T>;
fn gas_meter_mut(&mut self) -> &mut GasMeter<Self::T>;
-> encoding does not depend on T
fn call_runtime(&self, call: <Self::T as Config>::RuntimeCall) -> DispatchResultWithPostInfo;
-> Substrate specific, just an opaque blob of bytes from the contract's perspective
fn contract_info(&mut self) -> &mut ContractInfo<Self::T>;
fn transient_storage(&mut self) -> &mut TransientStorage<Self::T>;
-> gated by #[cfg(any(test, feature = "runtime-benchmarks"))]
```
---------
Co-authored-by:
Alexander Theißen <alex.theissen@me.com>
Showing
- prdoc/pr_5608.prdoc 16 additions, 0 deletionsprdoc/pr_5608.prdoc
- substrate/bin/node/runtime/src/lib.rs 0 additions, 5 deletionssubstrate/bin/node/runtime/src/lib.rs
- substrate/frame/revive/Cargo.toml 0 additions, 1 deletionsubstrate/frame/revive/Cargo.toml
- substrate/frame/revive/build.rs 0 additions, 78 deletionssubstrate/frame/revive/build.rs
- substrate/frame/revive/fixtures/contracts/balance.rs 3 additions, 6 deletionssubstrate/frame/revive/fixtures/contracts/balance.rs
- substrate/frame/revive/fixtures/contracts/call.rs 4 additions, 4 deletionssubstrate/frame/revive/fixtures/contracts/call.rs
- substrate/frame/revive/fixtures/contracts/call_return_code.rs 5 additions, 5 deletions...trate/frame/revive/fixtures/contracts/call_return_code.rs
- substrate/frame/revive/fixtures/contracts/call_runtime_and_call.rs 4 additions, 4 deletions.../frame/revive/fixtures/contracts/call_runtime_and_call.rs
- substrate/frame/revive/fixtures/contracts/call_with_flags_and_value.rs 5 additions, 5 deletions...me/revive/fixtures/contracts/call_with_flags_and_value.rs
- substrate/frame/revive/fixtures/contracts/call_with_limit.rs 2 additions, 2 deletionssubstrate/frame/revive/fixtures/contracts/call_with_limit.rs
- substrate/frame/revive/fixtures/contracts/caller_contract.rs 2 additions, 2 deletionssubstrate/frame/revive/fixtures/contracts/caller_contract.rs
- substrate/frame/revive/fixtures/contracts/chain_extension_temp_storage.rs 4 additions, 4 deletions...revive/fixtures/contracts/chain_extension_temp_storage.rs
- substrate/frame/revive/fixtures/contracts/common/src/lib.rs 27 additions, 0 deletionssubstrate/frame/revive/fixtures/contracts/common/src/lib.rs
- substrate/frame/revive/fixtures/contracts/create_storage_and_call.rs 2 additions, 2 deletions...rame/revive/fixtures/contracts/create_storage_and_call.rs
- substrate/frame/revive/fixtures/contracts/create_storage_and_instantiate.rs 3 additions, 3 deletions...vive/fixtures/contracts/create_storage_and_instantiate.rs
- substrate/frame/revive/fixtures/contracts/create_transient_storage_and_call.rs 1 addition, 1 deletion...e/fixtures/contracts/create_transient_storage_and_call.rs
- substrate/frame/revive/fixtures/contracts/delegate_call_lib.rs 3 additions, 4 deletions...rate/frame/revive/fixtures/contracts/delegate_call_lib.rs
- substrate/frame/revive/fixtures/contracts/destroy_and_transfer.rs 2 additions, 2 deletions...e/frame/revive/fixtures/contracts/destroy_and_transfer.rs
- substrate/frame/revive/fixtures/contracts/drain.rs 4 additions, 7 deletionssubstrate/frame/revive/fixtures/contracts/drain.rs
- substrate/frame/revive/fixtures/contracts/event_and_return_on_deploy.rs 2 additions, 1 deletion...e/revive/fixtures/contracts/event_and_return_on_deploy.rs
Please register or sign in to comment