-
Notifications
You must be signed in to change notification settings - Fork 776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pallet-revive] update generic runtime types #5608
Conversation
Let's stay silent before 1.0 to not clutter the changelog with information of a not ready to use pallet. Still need a prdoc for the bumps though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tested your branch with the compiler, the balance syscall passes against geth EVM for selfbalance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the usage of SCALE where it became possible due to having a concrete type? I put some example comments where this was the case.
And yeah let's not sweat removing the T
for now.
a44e7d7
to
1b2ed74
Compare
Made the change in the last commit. SCALE is mostly used now for substrate specific host fns (call_runtime and xcm) |
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"))] ```
fix #5574
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