File tree Expand file tree Collapse file tree 9 files changed +370
-280
lines changed
Expand file tree Collapse file tree 9 files changed +370
-280
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 4747 @ echo " Running cargo clippy with automatic fixes on potentially dirty code..."
4848 just clippy-fix
4949 @ echo " Running cargo clippy..."
50- just clippy
50+ just clippy
51+
52+ production :
53+ @ echo " Running cargo build with metadata-hash generation..."
54+ cargo + {{ RUSTV}} build --profile production --features=" runtime-benchmarks metadata-hash"
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ sp-io = { workspace = true }
5454sp-timestamp = { workspace = true }
5555sp-inherents = { workspace = true }
5656sp-keyring = { workspace = true }
57+ frame-metadata-hash-extension = { workspace = true }
5758frame-system = { workspace = true }
5859pallet-transaction-payment = { workspace = true }
5960pallet-commitments = { path = " ../pallets/commitments" }
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ pub fn create_benchmark_extrinsic(
136136 pallet_transaction_payment:: ChargeTransactionPayment :: < runtime:: Runtime > :: from ( 0 ) ,
137137 pallet_subtensor:: SubtensorSignedExtension :: < runtime:: Runtime > :: new ( ) ,
138138 pallet_commitments:: CommitmentsSignedExtension :: < runtime:: Runtime > :: new ( ) ,
139+ frame_metadata_hash_extension:: CheckMetadataHash :: < runtime:: Runtime > :: new ( true ) ,
139140 ) ;
140141
141142 let raw_payload = runtime:: SignedPayload :: from_raw (
@@ -152,6 +153,7 @@ pub fn create_benchmark_extrinsic(
152153 ( ) ,
153154 ( ) ,
154155 ( ) ,
156+ None ,
155157 ) ,
156158 ) ;
157159 let signature = raw_payload. using_encoded ( |e| sender. sign ( e) ) ;
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ pallet-timestamp = { workspace = true }
4141pallet-transaction-payment = { workspace = true }
4242pallet-utility = { workspace = true }
4343frame-executive = { workspace = true }
44+ frame-metadata-hash-extension = { workspace = true }
4445sp-api = { workspace = true }
4546sp-block-builder = { workspace = true }
4647sp-consensus-aura = { workspace = true }
@@ -111,6 +112,7 @@ std = [
111112 " codec/std" ,
112113 " scale-info/std" ,
113114 " frame-executive/std" ,
115+ " frame-metadata-hash-extension/std" ,
114116 " frame-support/std" ,
115117 " frame-system-rpc-runtime-api/std" ,
116118 " frame-system/std" ,
@@ -204,3 +206,4 @@ try-runtime = [
204206 " pallet-commitments/try-runtime" ,
205207 " pallet-registry/try-runtime"
206208]
209+ metadata-hash = [" substrate-wasm-builder/metadata-hash" ]
Original file line number Diff line number Diff line change 11fn main ( ) {
2- #[ cfg( feature = "std" ) ]
2+ #[ cfg( all ( feature = "std" , not ( feature = "metadata-hash" ) ) ) ]
33 {
44 substrate_wasm_builder:: WasmBuilder :: new ( )
55 . with_current_project ( )
66 . export_heap_base ( )
77 . import_memory ( )
88 . build ( ) ;
99 }
10+ #[ cfg( all( feature = "std" , feature = "metadata-hash" ) ) ]
11+ {
12+ substrate_wasm_builder:: WasmBuilder :: new ( )
13+ . with_current_project ( )
14+ . export_heap_base ( )
15+ . import_memory ( )
16+ . enable_metadata_hash ( "TAO" , 9 )
17+ . build ( ) ;
18+ }
1019}
Original file line number Diff line number Diff line change @@ -1282,6 +1282,7 @@ pub type SignedExtra = (
12821282 pallet_transaction_payment:: ChargeTransactionPayment < Runtime > ,
12831283 pallet_subtensor:: SubtensorSignedExtension < Runtime > ,
12841284 pallet_commitments:: CommitmentsSignedExtension < Runtime > ,
1285+ frame_metadata_hash_extension:: CheckMetadataHash < Runtime > ,
12851286) ;
12861287
12871288type Migrations = pallet_grandpa:: migrations:: MigrateV4ToV5 < Runtime > ;
Original file line number Diff line number Diff line change 1- cargo build --profile production --features runtime-benchmarks
1+ cargo build --profile production --features " runtime-benchmarks metadata-hash "
22
You can’t perform that action at this time.
0 commit comments