Skip to content
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

enable metadata hash #2786

Merged
merged 8 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 33 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions runtime/acala/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ hex-literal = { workspace = true }

# substrate
frame-executive = { workspace = true }
# frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
Expand Down Expand Up @@ -153,6 +154,7 @@ std = [
"serde_json/std",

"frame-benchmarking/std",
# "frame-metadata-hash-extension/std",
"frame-executive/std",
"frame-support/std",
"frame-system-rpc-runtime-api/std",
Expand Down
4 changes: 3 additions & 1 deletion runtime/acala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ where
frame_system::CheckGenesis::<Runtime>::new(),
frame_system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
runtime_common::CheckNonce::<Runtime>::from(nonce),
frame_metadata_hash_extension::CheckMetadataHash::new(true),
frame_system::CheckWeight::<Runtime>::new(),
xlc marked this conversation as resolved.
Show resolved Hide resolved
module_evm::SetEvmOrigin::<Runtime>::new(),
module_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
Expand Down Expand Up @@ -1963,6 +1964,7 @@ pub type SignedExtra = (
frame_system::CheckEra<Runtime>,
runtime_common::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
// `SetEvmOrigin` needs ahead of `ChargeTransactionPayment`, we set origin in `SetEvmOrigin::validate()`, then
// `ChargeTransactionPayment::validate()` can process erc20 token transfer successfully in the case of using erc20
// as fee token.
Expand Down Expand Up @@ -2542,7 +2544,7 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig
}
}

let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone();
let (_, _, _, _, mortality, check_nonce, _, _, _, charge) = extra.clone();

if mortality != frame_system::CheckEra::from(sp_runtime::generic::Era::Immortal) {
// require immortal
Expand Down
2 changes: 2 additions & 0 deletions runtime/karura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ hex-literal = { workspace = true }

# substrate
frame-executive = { workspace = true }
# frame-metadata-hash-extension = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
Expand Down Expand Up @@ -155,6 +156,7 @@ std = [
"serde_json/std",

"frame-benchmarking/std",
# "frame-metadata-hash-extension/std",
"frame-executive/std",
"frame-support/std",
"frame-system-rpc-runtime-api/std",
Expand Down
4 changes: 3 additions & 1 deletion runtime/karura/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@ where
frame_system::CheckEra::<Runtime>::from(generic::Era::mortal(period, current_block)),
runtime_common::CheckNonce::<Runtime>::from(nonce),
frame_system::CheckWeight::<Runtime>::new(),
frame_metadata_hash_extension::new(true),
module_evm::SetEvmOrigin::<Runtime>::new(),
module_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
);
Expand Down Expand Up @@ -1991,6 +1992,7 @@ pub type SignedExtra = (
frame_system::CheckEra<Runtime>,
runtime_common::CheckNonce<Runtime>,
frame_system::CheckWeight<Runtime>,
frame_metadata_hash_extension::CheckMetadataHash<Runtime>,
// `SetEvmOrigin` needs ahead of `ChargeTransactionPayment`, we set origin in `SetEvmOrigin::validate()`, then
// `ChargeTransactionPayment::validate()` can process erc20 token transfer successfully in the case of using erc20
// as fee token.
Expand Down Expand Up @@ -2568,7 +2570,7 @@ impl Convert<(RuntimeCall, SignedExtra), Result<(EthereumTransactionMessage, Sig
}
}

let (_, _, _, _, mortality, check_nonce, _, _, charge) = extra.clone();
let (_, _, _, _, mortality, check_nonce, _, _, _, charge) = extra.clone();

if mortality != frame_system::CheckEra::from(sp_runtime::generic::Era::Immortal) {
// require immortal
Expand Down
Loading