Skip to content

[Bug] Missing states for getTransactionInfo  #7

@piotrpietruszka

Description

@piotrpietruszka

Problem

At the moment of the call we know that transaction exists, but instead of returning pending state it is treated as not found.

Current flow

  1. Creating TX:
{"jsonrpc":"2.0","id":3,"method":"hypersdk.submitTx","params":{"tx":[0,0,1,145,235,183,177,144,140,20,20,91,11,0,136,246,255,252,176,181,159,97,108,66,253,41,120,140,137,190,69,93,152,204,243,68,100,165,225,120,0,0,0,0,0,0,1,110,1,0,0,216,54,63,160,11,17,23,232,137,131,146,62,75,98,255,80,250,116,192,103,243,130,187,162,21,225,197,204,115,246,66,245,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,66,64,0,0,0,0,0,214,6,142,254,183,99,198,222,39,92,31,22,227,18,246,148,210,147,219,159,71,74,233,124,155,200,147,216,127,98,19,230,101,109,166,45,98,103,147,210,206,202,207,71,132,172,191,10,154,202,110,101,237,184,173,209,125,150,122,132,140,145,242,236,233,3,51,218,7,59,173,200,21,176,50,222,151,38,25,191,154,194,128,228,161,108,225,75,152,203,122,120,80,249,100,10]}}

{
    "jsonrpc": "2.0",
    "result": {
        "txId": "2BXbsTS4K2Era4aXiPSipaPS8aWrRYTatcSmtFxz8onqSrBbU6"
    },
    "id": 3
}
  1. Fetching TX (which is not true, we know that this exists):
{"jsonrpc":"2.0","id":40,"method":"nuklaivm.tx","params":{"txId":"2BXbsTS4K2Era4aXiPSipaPS8aWrRYTatcSmtFxz8onqSrBbU6"}}

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32000,
        "message": "tx not found",
        "data": null
    },
    "id": 40
}
  1. After 5s fetching TX:
{"jsonrpc":"2.0","id":68,"method":"nuklaivm.tx","params":{"txId":"2BXbsTS4K2Era4aXiPSipaPS8aWrRYTatcSmtFxz8onqSrBbU6"}}

{
    "jsonrpc": "2.0",
    "result": {
        "timestamp": 1726236555200,
        "success": true,
        "units": [
            224,
            7,
            14,
            50,
            26
        ],
        "fee": 321
    },
    "id": 68
}

Expected

In a response pending state should be distinct.

  1. Creating TX:
{
    "jsonrpc": "2.0",
    "result": {
        "txId": "2BXbsTS4K2Era4aXiPSipaPS8aWrRYTatcSmtFxz8onqSrBbU6"
    },
    "id": 3
}

or better unify responses (it's very natural that create transaction endpoint will return transaction model):

{
    "jsonrpc": "2.0",
    "result": {
        "timestamp": 1726236555200,
        "status": "CREATED",  <- NEW FIELD
        "units": [
            ...
        ],
        "fee": 321
    },
    "id": 68
}
  1. Fetching TX (pending):
{
    "jsonrpc": "2.0",
    "result": {
        "timestamp": 1726236555200,
        "status": "PENDING",  <- NEW FIELD
        "units": [
            ...
        ],
        "fee": 321
    },
    "id": 68
}
  1. After 5s fetching TX:
{
    "jsonrpc": "2.0",
    "result": {
        "timestamp": 1726236555200,
        "status": "SUCCESS",  <- NEW FIELD
        "units": [
            ...
        ],
        "fee": 321
    },
    "id": 68
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions