Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rosetta: return success tx status when the receipt is failed #12153

Open
telezhnaya opened this issue Sep 26, 2024 · 0 comments
Open

rosetta: return success tx status when the receipt is failed #12153

telezhnaya opened this issue Sep 26, 2024 · 0 comments

Comments

@telezhnaya
Copy link
Contributor

telezhnaya commented Sep 26, 2024

Description

curl -H "Content-Type: application/json" -d '{ "network_identifier": {"blockchain":"nearprotocol", "network": "mainnet"}, "block_identifier": {"index":128060749}, "transaction_identifier": {"hash": "receipt:2Poz1xup9NKD76RNDQtPMxXBndFnpUbNwGdMZWr8BZQC"} }' 'https://<url>/block/transaction' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   820  100   610  100   210    209     72  0:00:02  0:00:02 --:--:--   281
{
  "transaction": {
    "transaction_identifier": {
      "hash": "receipt:2Poz1xup9NKD76RNDQtPMxXBndFnpUbNwGdMZWr8BZQC"
    },
    "operations": [
      {
        "operation_identifier": {
          "index": 0
        },
        "type": "TRANSFER",
        "status": "SUCCESS",
        "account": {
          "address": "bisontrails2.poolv1.near"
        },
        "amount": {
          "value": "40077904915200000000",
          "currency": {
            "symbol": "NEAR",
            "decimals": 24
          }
        },
        "metadata": {
          "predecessor_id": {
            "address": "4819e2ddccd9860484b7ddc53b1196e6fef8f7351a0d01dc658752b00623b600"
          }
        }
      }
    ],
    "related_transactions": [
      {
        "transaction_identifier": {
          "hash": "receipt:4mMpYXMUnoAUEJ63C2XgJ4SSRMixAiQGd45mWp4LEBQL"
        },
        "direction": "forward"
      }
    ],
    "metadata": {
      "type": "TRANSACTION"
    }
  }
}

https://nearblocks.io/txns/5Jnfbm5xddRxaehAhJ8oP9AjYQZ6bcs3qYxW7LXyypXy#execution

Is it by design?
Looks so:

/// Operations contain all balance-changing information within a transaction.
/// They are always one-sided (only affect 1 AccountIdentifier) and can
/// succeed or fail independently from a Transaction.

But it's confusing and may mislead the users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant