Weight
Composite 11 v393sp_weights::weight_v2::Weight
About This Type
Transaction weight measuring computational cost.
Substrate Weight tracks execution time (ref_time) and proof size. Used to calculate transaction fees and ensure blocks do not exceed resource limits.
Common Uses
- • Fee estimation
- • Block weight limits
- • Benchmarking extrinsics
Fields (2)
| # | Name | Type |
|---|---|---|
| 0 | ref_time | Compact<u64> |
| 1 | proof_size | Compact<u64> |
SCALE Encoding
- Rule
- 2 fields encoded consecutively in declaration order. No field names or delimiters.
- Size
- sum of field sizes
Examples
Struct with 2 fields = ref_time: Compact<u64>, proof_size: Compact<u64>
0x<field0><field1>field 0 ref_time: Compact<u64>field 1 proof_size: Compact<u64>Code Examples
import { TypeRegistry } from "@polkadot/types";
const registry = new TypeRegistry();
// Encode Weight
const value = registry.createType("Weight", {
ref_time: 0,
proof_size: 0
});
console.log("Hex:", value.toHex());Referenced By (21)
#10 PerDispatchClass via normal#10 PerDispatchClass via operational#10 PerDispatchClass via mandatory#23 DispatchEventInfo via weight#110 BlockWeights via base_block#110 BlockWeights via max_block#112 WeightsPerClass via base_extrinsic#113 Option via Some#158 Utility::Call via with_weight.weight#163 Sudo::Call via sudo_unchecked_weight.weight#164 Multisig::Call via as_multi.max_weight#164 Multisig::Call via approve_as_multi.max_weight#366 Contracts::Call via call.gas_limit#366 Contracts::Call via instantiate_with_code.gas_limit#366 Contracts::Call via instantiate.gas_limit#366 Contracts::Call via migrate.weight_limit#592 RuntimeDispatchInfo via weight#613 ContractResult via gas_consumed#613 ContractResult via gas_required#621 ContractResult via gas_consumed
and 1 more...
Type Information
- Type ID
- 11
- Kind
- Composite
- Path
- sp_weights::weight_v2::Weight
- Runtime
- v393