Open lukaw3d opened 2 years ago
Originally posted by @buberdds in https://github.com/oasisprotocol/oasis-wallet-web/issues/958#issuecomment-1206085968
Originally posted by @lukaw3d in https://github.com/oasisprotocol/oasis-wallet-web/issues/958#issuecomment-1206817100
Discussed with Nikola that we could also show amounts with +/- prefix (except for transactions like set allowance)
About roothash.ExecutorCommit:
ExecutorCommit contains events relating to your account. Some transactions (e.g. withdrawing from paratime) SOMETIMES only emit an event, without a standalone transaction. Oasisscan also only indexes Emerald paratime transactions, so events provide additional information. But sometimes they provide duplicated information. And we can’t deduplicate by transaction hash
Depending on how oasisindexer implements things, perhaps this is not an issue there. AFAIK they are indexing events.
Example of transactions after depositing to Emerald (with already sufficient allowance)
We currently show:
Information we can use in oasisscan:
roothash.ExecutorCommit transaction contains two events relating to oasis1qrtyn2q78jv6plrmexrsrv4dh89wv4n49udtg2km https://testnet.oasisscan.com/transactions/f595338715390146fc885628a86ae6750210087695d9f2de0c0cbe10e1d4d352
"events": [
{
"staking": {
"height": 11177686,
"tx_hash": "f595338715390146fc885628a86ae6750210087695d9f2de0c0cbe10e1d4d352", //
"transfer": { //
"from": "oasis1qrtyn2q78jv6plrmexrsrv4dh89wv4n49udtg2km",
"to": "oasis1qr629x0tg9gm5fyhedgs9lw5eh3d8ycdnsxf0run", // emerald testnet addr
"amount": "1110000000"
}
}
},
{
"staking": {
"height": 11177686,
"tx_hash": "f595338715390146fc885628a86ae6750210087695d9f2de0c0cbe10e1d4d352", //
"allowance_change": { //
"owner": "oasis1qrtyn2q78jv6plrmexrsrv4dh89wv4n49udtg2km",
"beneficiary": "oasis1qr629x0tg9gm5fyhedgs9lw5eh3d8ycdnsxf0run", // emerald testnet addr
"allowance": "690000000",
"negative": true,
"amount_change": "1110000000"
}
}
},
consensus.Deposit transaction https://testnet.oasisscan.com/paratimes/transactions/a19206099ab7827f77791f0b85fc0736dee8affea4492bbe8f14669536a79b47?runtime=00000000000000000000000000000000000000000000000072c8215e60d5bca7
{
"txHash": "a19206099ab7827f77791f0b85fc0736dee8affea4492bbe8f14669536a79b47", //
"round": 1086667,
"ctx": {
"method": "consensus.Deposit", //
"from": "oasis1qrtyn2q78jv6plrmexrsrv4dh89wv4n49udtg2km",
"to": "oasis1qzu5vjcjk5gn036vyr47vetaktj4ry9qeqdzmh54", // oasis1 format of 0x5a8980d11a56597092D542d45292A68Caed59807
"amount": "1.11",
"nonce": 10
},
"events": {
"type": "deposit",
"round": 1086668,
"from": "oasis1qrtyn2q78jv6plrmexrsrv4dh89wv4n49udtg2km",
"to": "oasis1qzu5vjcjk5gn036vyr47vetaktj4ry9qeqdzmh54", // oasis1 format of 0x
"nonce": 10,
"tx_hash": "0000000000000000000000000000000000000000000000000000000000000000",
"position": 0,
"i": 0,
"owner": null,
"amount": [],
"error": null
},
"runtimeId": "00000000000000000000000000000000000000000000000072c8215e60d5bca7",
"runtimeName": "Emerald",
"timestamp": 1660661828,
"type": "regular",
"result": true,
"message": "null",
"etx": null
}
Further indexing (path) of events is sufficient then?
Some transactions (e.g. withdrawing from paratime) SOMETIMES only emit an event, without a standalone transaction.
This is not deterministic?
not deterministic. it depends on executor behavior
On Mon, Oct 10, 2022, 5:38 PM Xi Zhang @.***> wrote:
Further indexing (path) of events is sufficient then?
Some transactions (e.g. withdrawing from paratime) SOMETIMES only emit an event, without a standalone transaction.
This is not deterministic?
— Reply to this email directly, view it on GitHub https://github.com/oasisprotocol/oasis-wallet-web/issues/752#issuecomment-1273945903, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJDVILRRTYTEIUIIMDRSWELWCSZJ7ANCNFSM5QQVYYQQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
-- Disclaimer: This e-mail and any attachments may contain confidential information. If you are not the intended recipient, any disclosure, copying, distribution or use of any information contained herein is strictly prohibited. If you have received this transmission in error, please immediately notify the sender and destroy the original transmission and any attachments without reading or saving.
StakingAllow
andRoothashExecutorCommit
will appear quite often, so they should be handled nicelyCurrent display https://wallet.oasisprotocol.org/account/oasis1qq3833fnmkqe94h0ca6w8qa84sq8pu92qsjmfayj :
Related code: https://github.com/oasisprotocol/oasis-wallet-web/blob/59751cc512c7e7ba2b725cf8ddabf61ba23533b4/src/app/components/Transaction/index.tsx#L159-L170