Operations and Tx Status must be consistent with the network options.
Closed this issue · 0 comments
jgimeno commented
If we query Network Options we receive right now this information:
{
"version": {
"rosetta_version": "1.2.5",
"node_version": "0.33.6"
},
"allow": {
"operation_statuses": [
{
"status": "Success",
"successful": true
},
{
"status": "Reverted",
"successful": false
}
],
"operation_types": [
"Transfer"
],
"errors": null,
"historical_balance_lookup": false
}
}
The operation types we support and the status this operations can have. But with a block that has a MsgSend transaction I see this:
{
"block": {
"block_identifier": {
"index": 2898,
"hash": "2A94130D6C394572E127E74ECF16939003CBB7EC886BEDBFF93A578B10B4FEE2"
},
"parent_block_identifier": {
"index": 2897,
"hash": "70DF14681054DA46C61E8349E97E62684F8F0952FE50EABCF96F41446803DF4C"
},
"timestamp": 1598538375795,
"transactions": [
{
"transaction_identifier": {
"hash": "68DEF4A27152876244EC15DF5C7A30D750B3E9D7989B860A011AA143166D79CC"
},
"operations": [
{
"operation_identifier": {
"index": 0
},
"type": "cosmos-sdk/MsgSend",
"status": "Exchange",
"account": {
"address": "cosmos1p6rdlykx6n65n0694w4dm6sslejld929fslcqu"
},
"amount": {
"value": "-1",
"currency": {
"symbol": "atom",
"decimals": 0
}
}
},
{
"operation_identifier": {
"index": 1
},
"type": "cosmos-sdk/MsgSend",
"status": "Exchange",
"account": {
"address": "cosmos1qd8rl9j0fuzpluj6g2sczsplvmfq5ar9k5mcnv"
},
"amount": {
"value": "1",
"currency": {
"symbol": "atom",
"decimals": 0
}
}
}
]
}
]
}
}
I see two things here, first one or the config supported operations we set cosmos-sdk/MsgSend or we return "Transfer", and the other thing are the status. So we must return "Success" or "Reverted". The Exchange one now should be "Success" but we need to test a MsgSend tx that fails. (maybe sending wrong balance) and show "Reverted" if that is the case. We need to investigate how a Tx that is reverted looks like from cosmos sdk.