aeternity / aepp-sdk-go

Golang SDK to interact with the Æternity blockchain
ISC License
18 stars 10 forks source link

json: cannot unmarshal number 8.739103535663958e18 into Go struct field KeyBlock.nonce of type uint64 #74

Closed smirkcat closed 5 years ago

smirkcat commented 5 years ago

RT. json: cannot unmarshal number 8.739103535663958e18 into Go struct field KeyBlock.nonce of type uint64

image

randomshinichi commented 5 years ago

Hi, could you provide a bit more detail on how you triggered this? I think I have seen this before but am not sure whether I dealt with it already.

smirkcat commented 5 years ago

I want to scan the transaction, i change there image it will work ok

randomshinichi commented 5 years ago

Well... it's not as simple as that unfortunately.

I recently reworked the PrintGenerationByHeight() function in https://github.com/aeternity/aepp-sdk-go/tree/apirefactor, see if it still works for you.

I can't think of how nonce could possibly be a float, plus the max of uint64 is 1,8447×10¹⁹. If you could send me a transaction hash that reproduces this error on the testnet/mainnet, I could take a closer look.

smirkcat commented 5 years ago

En .. I use master branch image I add this , then I rebuild and install
image I use node https://roma-net.mdw.aepps.com image

smirkcat commented 5 years ago

And then the node https://sdk-testnet.aepps.com image

randomshinichi commented 5 years ago

Seems to be fixed somehow.

hinichi@ilya:~ aecli-go -u http://sdk-testnet.aepps.com chain play --height 97739
<Generation>
  <KeyBlock>
    Beneficiary_____________________________________ ak_2iBPH7HUz3cSDVEUWiHg76MZJ6tZooVNBmmxcgVK6VV8KAE688
    Hash____________________________________________ kh_66Cz1U8kzMWwgmkQJW2vjtVQTosYKReeLCiuiJVwfitDiG4uC
    Height__________________________________________ 97739
    Info____________________________________________ cb_AAAAAfy4hFE=
    Miner___________________________________________ ak_mFT5uv1KjLRf9jxKNku3Weueer3i55CkevqmbnWbSj7TjkEQs
    Nonce___________________________________________ 3869388679254294607
    PrevHash________________________________________ kh_qY5fxKTf4yXDQbLUdgfn4mwgrNF2RT2psDCFvgRBuRMwysmXd
    PrevKeyHash_____________________________________ kh_qY5fxKTf4yXDQbLUdgfn4mwgrNF2RT2psDCFvgRBuRMwysmXd
    StateHash_______________________________________ bs_8rEKG7PD6BtjzRYnjU3AcqPmcP5ChpcdaHGkfJZScBrpyp2DF
    Target__________________________________________ 538903455
    Time____________________________________________ 2019-06-20T06:52:50+02:00
    Version_________________________________________ 3
  </KeyBlock>
</Generation>

<Generation>
  <KeyBlock>
    Beneficiary_____________________________________ ak_2iBPH7HUz3cSDVEUWiHg76MZJ6tZooVNBmmxcgVK6VV8KAE688
    Hash____________________________________________ kh_qY5fxKTf4yXDQbLUdgfn4mwgrNF2RT2psDCFvgRBuRMwysmXd
    Height__________________________________________ 97738
    Info____________________________________________ cb_AAAAAfy4hFE=
    Miner___________________________________________ ak_2bdSrvkUaQC2ZokYuF6Z8LNDTQjUuVKLkn63Fj5VUd2LbfxC5T
    Nonce___________________________________________ 14896605460346086683
    PrevHash________________________________________ kh_kFqrmiqxoig1Pzy4RGE8RsZK6pcUvuJsxGEwx65Sqx339MU6R
    PrevKeyHash_____________________________________ kh_kFqrmiqxoig1Pzy4RGE8RsZK6pcUvuJsxGEwx65Sqx339MU6R
    StateHash_______________________________________ bs_2rgbc5NMKzJMZ3BrUryVLNDdM4LmCbFcVQw6XkaZoQW7fYFRLw
    Target__________________________________________ 538876657
    Time____________________________________________ 2019-06-20T06:48:11+02:00
    Version_________________________________________ 3
  </KeyBlock>
</Generation>

<Generation>
  <KeyBlock>
    Beneficiary_____________________________________ ak_2iBPH7HUz3cSDVEUWiHg76MZJ6tZooVNBmmxcgVK6VV8KAE688
    Hash____________________________________________ kh_kFqrmiqxoig1Pzy4RGE8RsZK6pcUvuJsxGEwx65Sqx339MU6R
    Height__________________________________________ 97737
    Info____________________________________________ cb_AAAAAfy4hFE=
    Miner___________________________________________ ak_MSFcVc8hU8SSfFG7rkZBRTMH6Y1cxDS3jxaeoV2yWxg8zmXLh
    Nonce___________________________________________ 2729754551954319216
    PrevHash________________________________________ kh_2J3u4WaenKo2ybdxohmUaM7j1CvANezdtqGgeGxET59wGLfr7F
    PrevKeyHash_____________________________________ kh_2J3u4WaenKo2ybdxohmUaM7j1CvANezdtqGgeGxET59wGLfr7F
    StateHash_______________________________________ bs_EGj1hVCGui8JyznfgcP6RmQ5hwxyVeFS8DxDddHLZ1X9y5bbH
    Target__________________________________________ 538927991
    Time____________________________________________ 2019-06-20T06:43:47+02:00
    Version_________________________________________ 3
  </KeyBlock>
</Generation>
smirkcat commented 5 years ago

@randomshinichi Still have some problems I add these image Then go build aepp-sdk-go.exe chain play -u https://sdk-testnet.aepps.com image

And then add image

then go build image The result

{
    "block_hash": "mh_Sq4VU12tp1i2Ltn6EWvHpKn26JXVfFnJTPf6SUyyqn6rLJAy",
    "block_height": {},
    "hash": "th_2EYXXQkNiMzsB38dyPXDAq9As4hK9k9wA7CeaW5cXFBPQw9Btf",
    "signatures": [
        "sg_UAaztdR4HSJcqo187yQq2x9XWVPDYBZB42noRjFaKyk1ZNmfkYFKpJMrmkDwMC74s6jonabyHeC6UsL45CQDTmaQYRfxv"
    ],
    "tx": {
        "amount": {},
        "fee": {},
        "nonce": 91517,
        "payload": "ba_MTExNzEzOmtoXzJhMkRvQTRiZlplVHhwVUFrZnVlRGRjQnhWdm1mamNqZVBMR2VkeTg3aGNVQXh1RWtwOm1oXzJmZGZDY0FKQUdBTlRqZFpUd01SUXRIVUd0VzJkV2tlZWFibUpTNVVmOG5pdlJhQWFCOjE1NjM1MjcwNDSJmM8P",
        "recipient_id": "ak_JGMjbAS6UBCmsZR3ck1UR5KXLaBp1bsckf7cJiMDw6av5C3ie",
        "sender_id": "ak_JGMjbAS6UBCmsZR3ck1UR5KXLaBp1bsckf7cJiMDw6av5C3ie",
        "ttl": 111723,
        "type": "SpendTx",
        "version": 1
    }
}

the amount、 fee and the block_height hava no result returned is {}