-
Notifications
You must be signed in to change notification settings - Fork 105
fix: estimate gas for bounded substrate accounts #1409
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
Changes from all commits
2723803
be7a50d
470e9ef
a46e75c
3248bd9
09e8cf6
ee45bed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -70,7 +70,7 @@ pub use sp_runtime::{ | |||||
| AccountIdConversion, BlakeTwo256, Block as BlockT, DispatchInfoOf, Dispatchable, PostDispatchInfoOf, | ||||||
| UniqueSaturatedInto, | ||||||
| }, | ||||||
| transaction_validity::{TransactionValidity, TransactionValidityError}, | ||||||
| transaction_validity::{InvalidTransaction, TransactionValidity, TransactionValidityError}, | ||||||
| DispatchError, Permill, TransactionOutcome, | ||||||
| }; | ||||||
|
|
||||||
|
|
@@ -457,7 +457,13 @@ impl fp_self_contained::SelfContainedCall for RuntimeCall { | |||||
| len: usize, | ||||||
| ) -> Option<Result<(), TransactionValidityError>> { | ||||||
| match self { | ||||||
| RuntimeCall::Ethereum(call) => call.pre_dispatch_self_contained(info, dispatch_info, len), | ||||||
| RuntimeCall::Ethereum(call) => { | ||||||
| // don't allow on-chain EVM transactions from a bound address | ||||||
| if EVMAccounts::bound_account_id(*info).is_some() { | ||||||
| return Some(Err(TransactionValidityError::Invalid(InvalidTransaction::BadSigner))); | ||||||
|
||||||
| return Some(Err(TransactionValidityError::Invalid(InvalidTransaction::BadSigner))); | |
| return Some(Err(TransactionValidityError::Invalid(InvalidTransaction::Call))); |
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.
Changing
AccountExtensionfrompub(super)topubexposes the raw storage map as part of the pallet’s Rust API, making it easier for other runtime code to write to it directly and bypass invariants/events (inc_sufficients,Boundevent, etc.). If this is only needed for integration tests, prefer a narrowly-scoped test helper (e.g., a function behind a dedicatedcfg(feature = "testing")/cfg(test)or a helper in the integration test harness that writes storage by key) to avoid broadening the pallet’s public surface area.