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

[BUG] NAV tx history throws errors for some tx #1450

Closed
smk762 opened this issue Aug 23, 2022 · 5 comments
Closed

[BUG] NAV tx history throws errors for some tx #1450

smk762 opened this issue Aug 23, 2022 · 5 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@smk762
Copy link

smk762 commented Aug 23, 2022

error from logs:

· 2022-08-22 22:05:17 +0200 [tx_history coin=NAV] utxo_common:2197] Error "utxo_common:2395] rpc_clients:1974] JsonRpcError { client_info: \"coin: NAV\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"4080\", method: \"blockchain.transaction.get\", params: [String(\"0dd22eceb2a4f0ffe211d62c7933ffbe71a01d9d635dfcde83617965ae459047\"), Bool(true)] }, error: Parse(electrum3.nav.community:40002, \"jsonrpc_client:463] error Error(\\\"invalid value: string \\\\\\\"cold_staking\\\\\\\", expected script type\\\", line: 0, column: 0) parsing result from response JsonRpcResponse { jsonrpc: \\\"2.0\\\", id: \\\"4080\\\", result: Object({\\\"hex\\\": String(\\\"03000000c403026301e905930a66e55a2d87275f10691630020b2a03a7ba44d08b1073fae7a6acf805010000006b483045022100dfb178b7313f58ad2079acd1994afd2218f02ccc8282bde738a0591ba712a8c9022059477b147747403c8658444598d5ca403ba8c039affbf3e1a66e3ca9facae5c00121023f95034812ec3c19e55eb592382d60865d781be852e932775b73323a89aa6aecffffffff0200ca9a3b000000001976a914e6761d199b7a3137c98056e49b7339b9a7ab3f5e88ac603d39830901000036c66376a914d5169fad89fc585816fb53615440b4cec510e46088ac6776a9142523d5cf81a07f0a7591af6733ea582da364306988ac680000000000\\\"), \\\"txid\\\": String(\\\"0dd22eceb2a4f0ffe211d62c7933ffbe71a01d9d635dfcde83617965ae459047\\\"), \\\"hash\\\": String(\\\"0dd22eceb2a4f0ffe211d62c7933ffbe71a01d9d635dfcde83617965ae459047\\\"), \\\"size\\\": Number(260), \\\"vsize\\\": Number(260), \\\"version\\\": Number(3), \\\"locktime\\\": Number(0), \\\"strdzeel\\\": String(\\\"\\\"), \\\"vchTxSig\\\": String(\\\"\\\"), \\\"vchBalanceSig\\\": String(\\\"\\\"), \\\"vin\\\": Array([Object({\\\"txid\\\": String(\\\"05f8aca6e7fa73108bd044baa7032a0b02301669105f27872d5ae5660a9305e9\\\"), \\\"vout\\\": Number(1), \\\"scriptSig\\\": Object({\\\"asm\\\": String(\\\"3045022100dfb178b7313f58ad2079acd1994afd2218f02ccc8282bde738a0591ba712a8c9022059477b147747403c8658444598d5ca403ba8c039affbf3e1a66e3ca9facae5c0[ALL] 023f95034812ec3c19e55eb592382d60865d781be852e932775b73323a89aa6aec\\\"), \\\"hex\\\": String(\\\"483045022100dfb178b7313f58ad2079acd1994afd2218f02ccc8282bde738a0591ba712a8c9022059477b147747403c8658444598d5ca403ba8c039affbf3e1a66e3ca9facae5c00121023f95034812ec3c19e55eb592382d60865d781be852e932775b73323a89aa6aec\\\")}), \\\"sequence\\\": Number(4294967295)})]), \\\"vout\\\": Array([Object({\\\"value\\\": Number(10.0), \\\"valueSat\\\": Number(1000000000), \\\"n\\\": Number(0), \\\"scriptPubKey\\\": Object({\\\"asm\\\": String(\\\"OP_DUP OP_HASH160 e6761d199b7a3137c98056e49b7339b9a7ab3f5e OP_EQUALVERIFY OP_CHECKSIG\\\"), \\\"hex\\\": String(\\\"76a914e6761d199b7a3137c98056e49b7339b9a7ab3f5e88ac\\\"), \\\"reqSigs\\\": Number(1), \\\"type\\\": String(\\\"pubkeyhash\\\"), \\\"addresses\\\": Array([String(\\\"NgvY6ZMtLoo2Zseh9MBgTTHN2Uvt6R5XsB\\\")])}), \\\"spendingKey\\\": String(\\\"\\\"), \\\"outputKey\\\": String(\\\"\\\"), \\\"ephemeralKey\\\": String(\\\"\\\"), \\\"vData\\\": String(\\\"\\\"), \\\"tokenId\\\": String(\\\"0000000000000000000000000000000000000000000000000000000000000000\\\"), \\\"rangeProof\\\": Bool(false)}), Object({\\\"value\\\": Number(11403.679), \\\"valueSat\\\": Number(1140367900000), \\\"n\\\": Number(1), \\\"scriptPubKey\\\": Object({\\\"asm\\\": String(\\\"OP_COINSTAKE OP_IF OP_DUP OP_HASH160 d5169fad89fc585816fb53615440b4cec510e460 OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 2523d5cf81a07f0a7591af6733ea582da3643069 OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF\\\"), \\\"hex\\\": String(\\\"c66376a914d5169fad89fc585816fb53615440b4cec510e46088ac6776a9142523d5cf81a07f0a7591af6733ea582da364306988ac68\\\"), \\\"reqSigs\\\": Number(1), \\\"type\\\": String(\\\"cold_staking\\\"), \\\"addresses\\\": Array([String(\\\"NfLgDYL4C3KKXDS8tLRAFM7spvLykV8v9A\\\"), String(\\\"NPJM7j7P9VhChdXCKRWFto1feWPYcAPQqW\\\")])}), \\\"spendingKey\\\": String(\\\"\\\"), \\\"outputKey\\\": String(\\\"\\\"), \\\"ephemeralKey\\\": String(\\\"\\\"), \\\"vData\\\": String(\\\"\\\"), \\\"tokenId\\\": String(\\\"0000000000000000000000000000000000000000000000000000000000000000\\\"), \\\"rangeProof\\\": Bool(false)})]), \\\"blockhash\\\": String(\\\"f7e67905738ff277497d730a405cbf61752cd728973081dd83862fa57d964d4b\\\"), \\\"height\\\": Number(6506904), \\\"confirmations\\\": Number(4001), \\\"time\\\": Number(1661076480), \\\"blocktime\\\": Number(1661076480)}), error: Null }\") }" on getting the details of 4cc8e8ff9b4128f8c013c6bea74d756b44f5f2c7faf9a6303acf9ffc1c4cdb46, skipping the tx

This looks like the details we need are part of the response, but they are being thwarted by the presence of an invalid value cold_staking within the response. I'll reach out to NAV to get more info about this param.

@aguycalled
Copy link

The response to that transaction is this:

  "vout": [
    {
      "value": 10,
      "valuesat": 1000000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 e6761d199b7a3137c98056e49b7339b9a7ab3f5e OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914e6761d199b7a3137c98056e49b7339b9a7ab3f5e88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "NgvY6ZMtLoo2Zseh9MBgTTHN2Uvt6R5XsB"
        ]
      },
      "spentTxId": "4cc8e8ff9b4128f8c013c6bea74d756b44f5f2c7faf9a6303acf9ffc1c4cdb46",
      "spentHeight": 6506904
    },
    {
      "value": 11403.679,
      "valuesat": 1140367900000,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_COINSTAKE OP_IF OP_DUP OP_HASH160 d5169fad89fc585816fb53615440b4cec510e460 OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_DUP OP_HASH160 2523d5cf81a07f0a7591af6733ea582da3643069 OP_EQUALVERIFY OP_CHECKSIG OP_ENDIF",
        "hex": "c66376a914d5169fad89fc585816fb53615440b4cec510e46088ac6776a9142523d5cf81a07f0a7591af6733ea582da364306988ac68",
        "reqSigs": 1,
        "type": "cold_staking",
        "addresses": [
          "NfLgDYL4C3KKXDS8tLRAFM7spvLykV8v9A",
          "NPJM7j7P9VhChdXCKRWFto1feWPYcAPQqW"
        ]
      }
    }
  ]

I think it just needs to accept the cold_staking type and consider the second element of the array addresses as the spending address. That output is spendable as a normal P2PKH script of that address.

@shamardy shamardy added the bug Something isn't working label Aug 29, 2022
@shamardy shamardy added this to Todo in MM 2.0 via automation Aug 29, 2022
@shamardy shamardy self-assigned this Aug 29, 2022
@shamardy shamardy moved this from Todo to In progress in MM 2.0 Sep 9, 2022
artemii235 pushed a commit that referenced this issue Sep 12, 2022
* NAV cold_staking script type

* move test tx JSONs to external file
@shamardy shamardy moved this from In progress to Testing in MM 2.0 Sep 12, 2022
@shamardy
Copy link
Collaborator

@smk762 can you please check if NAV tx history is working correctly now in the dev branch?

@smk762
Copy link
Author

smk762 commented Sep 12, 2022

@smk762 can you please check if NAV tx history is working correctly now in the dev branch?

I dont have any of these cold_staking addresses in any of my wallets, but have contacted willoncio#5015 who reported the issue and will create a custom gui build for him to test it (or figure out how to get one of these tx in my wallet)

@artemii235
Copy link
Member

@smk762 Can we consider this as done?

@smk762
Copy link
Author

smk762 commented Nov 17, 2022

User has not responded - we can close it. Will chase up again and they make contact I will let you know the outcome

MM 2.0 automation moved this from Testing to Done Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
MM 2.0
  
Done
Development

No branches or pull requests

4 participants