Questions tagged [events]

Questions that relate to pallets and disptachables that emit specific events, including decoding events.

Filter by
Sorted by
Tagged with
1 vote
2 answers
47 views

Why are events stored?

The documentation around emitting events states that events are written to storage, and then cleared next block. This has considerable costs You add extra db write/read overhead to practically every ...
user avatar
1 vote
1 answer
24 views

How do I get the block hash of an event?

I am subscribing system events using the events api. After I got the specific event I am looking for, how should get the block hash of this event? Thanks api.query.system.events((events) => { ...
user avatar
1 vote
0 answers
14 views

how to confirm a event type?

I query all events, and decode the event a known type, but maybe some write them cause error, how to parse the event pub fn decode_event(data: &str) -> Result<String> { let mut vec = ...
user avatar
  • 11
0 votes
1 answer
20 views

GSRPC: Check transaction failed?

Context: We are using GSRPC for interacting with a Polkadot Node. We are sending transactions using SubmitAndWatchExtrinsic. Question: How can I detect if the transaction failed? Note: I am aware ...
user avatar
  • 1
1 vote
1 answer
11 views

Will the event pairs `NewMultisig` <> `Reserved` and `MultisigExecuted` <> `Unreserved` always be emitted during a multisig transaction?

I would like to correctly monitor the events that are related to multisig transactions and I was wondering if I should always expect the following event pairs : NewMultisig <> Reserved ...
user avatar
  • 867
1 vote
2 answers
23 views

Parse block number from received system event

This seems very basic, but I'm unable to figure out at which block number an event was emitted. Specifically, I'm listening for Grandpa.NewAuthorities system event and just want to know at which block ...
user avatar
0 votes
1 answer
32 views

How can a recoverable account get notified when someone is initiated a recovery for it?

One of the interesting features of (social) account recovery in Kusama is that "If some one tries to initiate recovery for your recoverable account, you can close the process and kind of punish ...
user avatar
  • 397
0 votes
0 answers
33 views

From the parachain, how to read the relay chain events of a current block?

From this comment and this question, There's a function for runtime-benchmarks to get all the events(). And I want something similar that can be accessed from the parachain. Just events from the relay ...
user avatar
2 votes
0 answers
32 views

Emit Events from hooks like on_initialize()

Is it okay to emit event from hooks like on_initialize() ? For example I have ~1000 items in storage and in a loop in on_initialize() I want to emit event if certain process is completed then is it ...
user avatar
2 votes
1 answer
32 views

How can I access custom pallet Event data in a test?

I have an Event (ThingStored) that is deposited in a public function in my custom pallet. #[derive(Encode, Decode, PartialEq, Clone, RuntimeDebugNoBound, TypeInfo, MaxEncodedLen)] #[scale_info(...
user avatar
3 votes
1 answer
61 views

Emiting events does not work with cross contract calling

When using cross contract calling on another contract which also emits events the events of the original contract do not work anymore. I get the following error. error[E0283]: type annotations needed ...
user avatar
  • 87
0 votes
1 answer
34 views

How to assert deposited event in pallet call?

In testing my pallet, I have some function that stores something and deposits an event. #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event<T: ...
user avatar
2 votes
1 answer
33 views

How to recognise user behaviour data on substrate chains? (Events + Extrinsics)

Context: Specifically trying to measure user behaviour data on substrate chains. Questions: Is there any specific data that indicates whether a user triggered an extrinsic or an event? Do only ...
user avatar
1 vote
1 answer
36 views

Subscribing events from Polkadot blockchain

I would like to ask you how to subscribe events from Polkadot blockchain? I am writing a rust application and I need this functionality there. Is the using Substrate the right direction to achieve ...
user avatar
  • 13
1 vote
1 answer
36 views

Filter events for specific account in Polkadot.js/api

I am trying to get list events by filter for specific account(validator, nominator). I can get list of events using api.query.system.events(). However, if I get events for a day, there will be much ...
user avatar
3 votes
1 answer
106 views

Browse events in Polkadot.js/api

I want to get events list by using polkadot.js/api. I can see api.query.system.events() in docs. Docs: https://polkadot.js.org/docs/substrate/storage#eventcount-u32 However, this api lists events for ...
user avatar
4 votes
2 answers
157 views

Events in Polkadot.js/api

I am trying to call api.events.staking.Withdrawn.is in polkadot.js/api. Docs: https://polkadot.js.org/docs/substrate/events#withdrawnaccountid32-u128 Code sandbox: https://codesandbox.io/s/hardcore-...
user avatar
2 votes
1 answer
234 views

Decoding events with Rust

If I make a request to get events in a particular block using web UI, I get a nice human-readable response: I've made an RPC call to get the same data { "id": 1, "jsonrpc":...
user avatar
2 votes
1 answer
51 views

How to emit events from inner contracts

let's say we have a contract which calls other contract's function that emits an event. What is the approach to emit the event coming from the inner contract's message? Currently, there is only an ...
user avatar
  • 53
2 votes
1 answer
61 views

Event type & Call type

I am doing Substrate-tutorial and I just have a question about template-node. Inside impl 'frame_system::Config for Runtime {} code, there are type Event = Event and type Call = Call, but I don't see ...
user avatar
0 votes
1 answer
20 views

getReadProof for specific event

I want to generate a StorageProof for a specific event that is stored in storage. I have found System_Events but this returns me all events of a block, instead of a specific one. I stumbled on ...
user avatar
1 vote
1 answer
49 views

What's the Substrate's equivalent of receipts in Ethereum?

I want to check if a given extrinsic is executed successfully or not from a light client inside the enclave (aka Intel SGX). I am importing new blocks, iterating over the extrinsics I am interested in,...
user avatar
6 votes
2 answers
74 views

Should events only be emitted in extrinsics?

Suppose my pallet implements a trait MyTrait so that it can be loosely coupled with another pallet. Suppose also that MyTrait::my_function() makes storage modifications, which I would like to notify ...
user avatar
  • 411
5 votes
2 answers
66 views

Are there any event patterns for pallets to communicate within the runtime?

Could I have one pallet emit an event that other pallets are aware of? For example: assets-pallet emits an AssetCreated event market-pallet listens for the AssetCreated event So the assets-pallet is ...
user avatar
3 votes
2 answers
51 views

How to build prefixed key for rocksdb

I would like to know how can the key for the state System Events storage can be built for a given block hash/height
user avatar
1 vote
1 answer
37 views

Problem running assert_last_event in tests.rs

As the title suggests, I've been trying to call assert_last_event on the tests.rs class without success. The problem first happened when developing the kitties tutorial and after several toolchain ...
user avatar
  • 13
4 votes
2 answers
61 views

How to parse/match a specific frame_system event?

From the following function I can read the frame_system events: let events = frame_system::Pallet::<T>::read_events_no_consensus(); the above provides me the following example array: ...
user avatar
5 votes
2 answers
58 views

how to verify upward teleport on relay chain

I performed an upward teleport from Encointer parachain to Kusama relaychain. The parachain confirmed the XCM extrinsic polkadotXcm.limitedTeleportAssets and an Event was disposed: polkadotXcm....
user avatar
  • 363
4 votes
2 answers
46 views

error[E0599]: no function or associated item named `events` found for struct `frame_system::Pallet` in the current scope [closed]

When writing: let events = frame_system::Pallet::<T>::events(); I get the error: error[E0599]: no function or associated item named `events` found for struct `frame_system::Pallet` in the ...
user avatar
0 votes
1 answer
41 views

What does the Staking.EraPaid event mean?

According to Polkadot's events description page, the Staking.EraPaid event means the following: The era payout has been set; the first balance is the validator-payout; the second is the remainder ...
user avatar
5 votes
1 answer
56 views

Filter Events with subxt over multiple threads

I'm working on a project that uses Substrate in the backend. The System I am working on is written with Elixir and so I have a rustler NIF (Erlang/Elixir Native Function interface) for interacting ...
user avatar
  • 53
2 votes
2 answers
120 views

How to decode smart contract call and event data?

I want to decode the contract call data and event data saved in a block. How can I do that?
user avatar
5 votes
1 answer
34 views

Which data to put in a Pallet Event?

In other blockchains I practiced extreme frugality with event data, since it is expensive. For example only putting an ID into an event which can then be looked up with lookup(ID) -> ...
user avatar
4 votes
1 answer
69 views

Correlate events with extrinsics in a utility.batch call in Polkadot

In Polkadot and Kusama emitted module events has the phase property so we can correlate them with the extrinsic that triggered that event but I can not do the same when the extrinsic is included in a ...
user avatar