Questions tagged [events]
Questions that relate to pallets and disptachables that emit specific events, including decoding events.
62
questions
1
vote
1
answer
52
views
List all balance changes of an account on a Substrate-based chain
My goal is to list all balance changes for an account on a Substrate-based chain like Acala.
I assumed that on Substrate-based chains all incoming and outgoing values to and from an account would be ...
1
vote
1
answer
68
views
Querying events from storage migration
I'm currently attempting to perform a migration process that involves querying events emitted from a specific pallet. The objective of this migration is to extract relevant data from these events and ...
1
vote
0
answers
17
views
How to Securely Notify Users of New Messages in a Substrate-based Chat Application?
I'm developing a chat application using Substrate and facing a specific issue regarding user notifications. My application needs to notify users when they have a new message in a chat channel. ...
0
votes
1
answer
51
views
How to trace XCM messages for all parachains
Is it possible to trace XCM messages (origin para and account id, destination para and account id, instruction and parameters) just utilizing the relay chain storage? If not, what is the simplest way ...
2
votes
2
answers
43
views
How to ensure a call is the first to execute in a block?
As the title mention, I would like to know what would be the best way to ensure that an extrinsic can be executed only if it's the first call in the block (ignoring timestamp).
It also need to work ...
1
vote
1
answer
35
views
Pallet extrinsic event not triggering when called through chain extension
When I call the pallet extrinsic bond_and_stake, the Event BondAndStake gets triggered. But when I call it through the chain extension method from my ink smart contract message, the event does not ...
0
votes
1
answer
26
views
Do data in events increase the size of the block?
On one hand, if we emit extrinsic event with no data and other hand we emit the extrinsic event with data.
Will the second option will increase the block size or on both cases the block-size will be ...
0
votes
0
answers
28
views
How to log events on frontend dapp from emit_event of smart contract?
I'm currently struggling on obtaining logs of the events emitted from my smart contract on the frontend dapp. The smart contract code itself should work just fine as it emits the event perfectly fine ...
3
votes
1
answer
80
views
How to filter the subscribed contracts events with their topics?
I need to subscribe to my smart-contract events (#[ink(event)]). So I state_subscribeStorage to "System.Events" storage key. But then I get all system events of all smart contracts in my ...
5
votes
1
answer
117
views
How to identify received contract event?
My contract emits several [ink(event)] events. My application subscribes to the events and receives Contracts_ContractEmitted data (from centrifuge go-substrate-rpc-client). How may I understand which ...
4
votes
2
answers
42
views
DispatchError::Other(_) always being mapped to DispatchError::Other("")
I'm trying to pass some custom error messages to the frame_system::note_applied_extrinsic() but it seems to be ignoring my message and always using an empty string "".
Adding this test to ...
3
votes
1
answer
50
views
nextAuthorities() output clarification from Babe storage event
Good evening,
I am trying to parse the output hash of nextAuthorities details retrieved by storage function.
I would like to know how to parse the output sent per validator, is it an hashproof ...
3
votes
1
answer
66
views
Should events be taken into account if their extrinsic fails?
If the System.ExtrinsicFailed event was emitted within a given extrinsic, does it mean that all other events that were also emitted within it can be considered invalid and should not be taken into ...
1
vote
1
answer
156
views
the trait `std::clone::Clone` is not implemented for `Nominations<T>`
I was making a new event in the function nominate of Staking pallet which is going to show when the nominator is going to be added. But i facing one issue
#[pallet::call_index(5)]
#[pallet::weight(...
1
vote
1
answer
46
views
Ink Contracts: What Data Structures/Situations Are Best Suited To Contract Storage vs Events?
Using events to write data to the chain is great for registering information to the chain, especially information that you want a permanent record of. So my question is: under what circumstances ...
2
votes
1
answer
151
views
Need Help Understanding ink! Contract Storage And Data Access
There are some aspects of ink! contract storage and data access that I cannot find the answers to in the documentation or by experimentation. Here are my questions...
Is it true that there can be ...
1
vote
1
answer
52
views
polkadot.js | SignAndSend SuccessResponse does NOT contain all events emitted in tx
SignAndSend SuccessResponse that is a result of a contract call does NOT contain all events that are emitted during tx execution. The Object contains only events emitted from the contract that is ...
0
votes
1
answer
19
views
Unexpected Events from parainherit(enter) extrinsic
Can anyone explain why this module call parainherent(enter) ended up emitting a BatchCompleted and a couple ItemCompleted events? I'm unable to find any similar cases in westend.
1
vote
1
answer
80
views
Event encoding in substrate pallet
Can two pallets have exactly same event name and event parameters. If yes then is there a way to distinguish the event came from which pallet in golang.
1
vote
1
answer
52
views
How to get the contract address for a events
I am using
github.com/centrifuge/go-substrate-rpc-client
And able to get list of events from each block and also able to filter it out but is there a way to identify which contract triggered the event....
1
vote
1
answer
73
views
Is there a JSON-RPC method similar to `eth_getLogs`?
I was wondering if there is a JSON-RPC method similar to eth_getLogs.
What I would like to accomplish is to query all the events that meet a certain criteria, and that happened after a certain block. ...
1
vote
1
answer
28
views
Why do are some events in a block missing an extrinsic_idx?
Using py-substrate-interface to parse block data, we noticed that some events return None for the extrinsic_idx parameter.
Would someone please be so kind to explain why an event wouldn't have an ...
1
vote
2
answers
436
views
How to query events?
I need to get a list of all events of a specific custom type. In the documentation, it said that I can query the System pallet's storage for events. I am looking for an example (in Rust) of how to ...
0
votes
0
answers
68
views
Indexing: big Events vs. storage lookup. Downsides of having big Events
Problem statement:
While indexing it's impossible to extract information from the Extrinsic call when Extrinsic has optional parameters (default if none).
Solutions:
storage lookup (seems suboptimal ...
2
votes
1
answer
40
views
How use Metadata deocde Vec::<EventRecord<Event, H256>>
first get the system eventData state_getStorage api
now i need to decode the system eventData by metadata
is there some example how to decode it ?
for some reaseon ,only rust worker it ,thanks
5
votes
2
answers
113
views
Large event payloads unsafe?
Premise
Substrate will, by default, store every event in a block in a storage value Event of type Vec<EventRecord> in the system module, which involves reading & writing this full vector ...
3
votes
1
answer
227
views
How to subscribe to contract events using RPC?
I'm looking to subscribe to events emitted from a contract.
I am currently creating a storage key for System Events, subscribing to it and filtering the events to get the one emitted by the contract I ...
2
votes
2
answers
128
views
How to save decoded events using polkadot.js?
I am monitoring the events when calling a method from my contract and want to
save the output of one of my custom events, to display it.
The call of my method looks like this:
contract.tx
.method({ ...
2
votes
2
answers
205
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 ...
1
vote
1
answer
298
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) => {
...
1
vote
0
answers
29
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 = ...
0
votes
1
answer
53
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 ...
1
vote
1
answer
15
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
...
1
vote
2
answers
63
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 ...
2
votes
1
answer
58
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 ...
1
vote
0
answers
64
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 ...
2
votes
1
answer
134
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 an event if certain process is completed, then is ...
2
votes
1
answer
90
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(...
3
votes
1
answer
165
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
...
1
vote
1
answer
130
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: ...
2
votes
1
answer
38
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 ...
1
vote
1
answer
74
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 ...
2
votes
1
answer
137
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 ...
3
votes
1
answer
242
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 ...
4
votes
2
answers
254
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-...
4
votes
1
answer
431
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":...
3
votes
1
answer
93
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 ...
3
votes
1
answer
100
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 ...
0
votes
1
answer
34
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 ...
1
vote
1
answer
64
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,...