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 47
47
@ echo " Running cargo clippy with automatic fixes on potentially dirty code..."
48
48
just clippy-fix
49
49
@ 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 }
54
54
sp-timestamp = { workspace = true }
55
55
sp-inherents = { workspace = true }
56
56
sp-keyring = { workspace = true }
57
+ frame-metadata-hash-extension = { workspace = true }
57
58
frame-system = { workspace = true }
58
59
pallet-transaction-payment = { workspace = true }
59
60
pallet-commitments = { path = " ../pallets/commitments" }
Original file line number Diff line number Diff line change @@ -136,6 +136,7 @@ pub fn create_benchmark_extrinsic(
136
136
pallet_transaction_payment:: ChargeTransactionPayment :: < runtime:: Runtime > :: from ( 0 ) ,
137
137
pallet_subtensor:: SubtensorSignedExtension :: < runtime:: Runtime > :: new ( ) ,
138
138
pallet_commitments:: CommitmentsSignedExtension :: < runtime:: Runtime > :: new ( ) ,
139
+ frame_metadata_hash_extension:: CheckMetadataHash :: < runtime:: Runtime > :: new ( true ) ,
139
140
) ;
140
141
141
142
let raw_payload = runtime:: SignedPayload :: from_raw (
@@ -152,6 +153,7 @@ pub fn create_benchmark_extrinsic(
152
153
( ) ,
153
154
( ) ,
154
155
( ) ,
156
+ None ,
155
157
) ,
156
158
) ;
157
159
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 }
41
41
pallet-transaction-payment = { workspace = true }
42
42
pallet-utility = { workspace = true }
43
43
frame-executive = { workspace = true }
44
+ frame-metadata-hash-extension = { workspace = true }
44
45
sp-api = { workspace = true }
45
46
sp-block-builder = { workspace = true }
46
47
sp-consensus-aura = { workspace = true }
@@ -111,6 +112,7 @@ std = [
111
112
" codec/std" ,
112
113
" scale-info/std" ,
113
114
" frame-executive/std" ,
115
+ " frame-metadata-hash-extension/std" ,
114
116
" frame-support/std" ,
115
117
" frame-system-rpc-runtime-api/std" ,
116
118
" frame-system/std" ,
@@ -204,3 +206,4 @@ try-runtime = [
204
206
" pallet-commitments/try-runtime" ,
205
207
" pallet-registry/try-runtime"
206
208
]
209
+ metadata-hash = [" substrate-wasm-builder/metadata-hash" ]
Original file line number Diff line number Diff line change 1
1
fn main ( ) {
2
- #[ cfg( feature = "std" ) ]
2
+ #[ cfg( all ( feature = "std" , not ( feature = "metadata-hash" ) ) ) ]
3
3
{
4
4
substrate_wasm_builder:: WasmBuilder :: new ( )
5
5
. with_current_project ( )
6
6
. export_heap_base ( )
7
7
. import_memory ( )
8
8
. build ( ) ;
9
9
}
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
+ }
10
19
}
Original file line number Diff line number Diff line change @@ -1282,6 +1282,7 @@ pub type SignedExtra = (
1282
1282
pallet_transaction_payment:: ChargeTransactionPayment < Runtime > ,
1283
1283
pallet_subtensor:: SubtensorSignedExtension < Runtime > ,
1284
1284
pallet_commitments:: CommitmentsSignedExtension < Runtime > ,
1285
+ frame_metadata_hash_extension:: CheckMetadataHash < Runtime > ,
1285
1286
) ;
1286
1287
1287
1288
type 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 "
2
2
You can’t perform that action at this time.
0 commit comments