mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 17:47:56 +00:00
Improve dynamic events type sizes API (#61)
* Do not error if type sizes missing: log warn * Split out EventsSubscriber, allow updating events decoder * Format code * Check missing type sizes after registration * Add example which for submit and watching events
This commit is contained in:
+15
-10
@@ -186,7 +186,8 @@ mod tests {
|
||||
let wasm = wabt::wat2wasm(CONTRACT).expect("invalid wabt");
|
||||
|
||||
client.xt(signer, None).and_then(|xt| {
|
||||
xt.submit_and_watch(super::put_code(500_000, wasm))
|
||||
xt.watch()
|
||||
.submit(super::put_code(500_000, wasm))
|
||||
.map(|result| result.find_event::<T::Hash>(MODULE, events::CODE_STORED))
|
||||
})
|
||||
}
|
||||
@@ -224,15 +225,19 @@ mod tests {
|
||||
println!("{:?}", code_hash);
|
||||
|
||||
let instantiate = client.xt(signer, None).and_then(move |xt| {
|
||||
xt.submit_and_watch(super::instantiate::<Runtime>(
|
||||
100_000_000_000_000,
|
||||
500_000,
|
||||
code_hash,
|
||||
Vec::new(),
|
||||
))
|
||||
.map(|result| {
|
||||
result.find_event::<(AccountId, AccountId)>(MODULE, events::INSTANTIATED)
|
||||
})
|
||||
xt.watch()
|
||||
.submit(super::instantiate::<Runtime>(
|
||||
100_000_000_000_000,
|
||||
500_000,
|
||||
code_hash,
|
||||
Vec::new(),
|
||||
))
|
||||
.map(|result| {
|
||||
result.find_event::<(AccountId, AccountId)>(
|
||||
MODULE,
|
||||
events::INSTANTIATED,
|
||||
)
|
||||
})
|
||||
});
|
||||
|
||||
let result = rt.block_on(instantiate).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user