mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 13:27:57 +00:00
Publish the dispatch info in extrinsic events (#4148)
* Publish the dispatch info in extrinsic events Place the DispatchInfo (which contains weight information about the extrinsic that is otherwise difficult to determine) in the dispatch result value. * Runtime bump. * Fix build * Fix tests * Fix build?
This commit is contained in:
@@ -37,7 +37,7 @@ mod tests {
|
||||
use runtime_support::{
|
||||
Hashable, StorageValue, StorageMap,
|
||||
traits::Currency,
|
||||
weights::GetDispatchInfo,
|
||||
weights::{GetDispatchInfo, DispatchInfo, DispatchClass},
|
||||
};
|
||||
use state_machine::TestExternalities as CoreTestExternalities;
|
||||
use primitives::{
|
||||
@@ -45,8 +45,7 @@ mod tests {
|
||||
traits::{CodeExecutor, Externalities}, storage::well_known_keys,
|
||||
};
|
||||
use sr_primitives::{
|
||||
Fixed64,
|
||||
traits::{Header as HeaderT, Hash as HashT, Convert}, ApplyResult,
|
||||
Fixed64, traits::{Header as HeaderT, Hash as HashT, Convert}, ApplyResult,
|
||||
transaction_validity::InvalidTransaction,
|
||||
};
|
||||
use contracts::ContractAddressFor;
|
||||
@@ -467,7 +466,9 @@ mod tests {
|
||||
let events = vec![
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(0),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess(
|
||||
DispatchInfo { weight: 10000, class: DispatchClass::Operational }
|
||||
)),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
@@ -487,7 +488,9 @@ mod tests {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess(
|
||||
DispatchInfo { weight: 1000000, class: DispatchClass::Normal }
|
||||
)),
|
||||
topics: vec![],
|
||||
},
|
||||
];
|
||||
@@ -516,7 +519,9 @@ mod tests {
|
||||
let events = vec![
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(0),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess(
|
||||
DispatchInfo { weight: 10000, class: DispatchClass::Operational }
|
||||
)),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
@@ -538,7 +543,9 @@ mod tests {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(1),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess(
|
||||
DispatchInfo { weight: 1000000, class: DispatchClass::Normal }
|
||||
)),
|
||||
topics: vec![],
|
||||
},
|
||||
EventRecord {
|
||||
@@ -560,7 +567,9 @@ mod tests {
|
||||
},
|
||||
EventRecord {
|
||||
phase: Phase::ApplyExtrinsic(2),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess),
|
||||
event: Event::system(system::Event::ExtrinsicSuccess(
|
||||
DispatchInfo { weight: 1000000, class: DispatchClass::Normal }
|
||||
)),
|
||||
topics: vec![],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user