node-nano-node icon indicating copy to clipboard operation
node-nano-node copied to clipboard

Slightly different block values of fetchAccount() vs. RPC account_history

Open thegafo opened this issue 7 years ago • 0 comments

Hi there. First off, thank you for publishing this library. It has been very helpful.

Maybe you can help me with this... I'm getting slightly different block values when calling fetchAccount() when compared to the standard RPC account_history command. See below:

Result for a block from standard RPC account_history:

    {
      "type": "state",
      "representative": "xrb_3dmtrrws3pocycmbqwawk6xs7446qxa36fcncush4s1pejk16ksbmakis78m",
      "link": "D13B986A0CF2BC94D5CA0082481E183DA46FE4563062CF3343EBDF6868081198",
      "balance": "3262708019134564853214085120",
      "previous": "27062303E310F7541E89CB3CF5E6436ADFEFF80F70C5A7E31FF9DDB2BD9F0415",
      "subtype": "receive",
      "account": "xrb_1setuaf6nzm7mfd5x1enuc8wx9hap6jhxqraz3an339ugq6f64f1u4rnzgod",
      "amount": "326270801913400000000000000",
      "hash": "5838BD8360C0FDEE00F7CF309277F2A1B63344178F8BEB3529ED996C35001C54",
      "work": "0000000005a1fa29",
      "signature": "185B9B69CAD6E005063E7A676111EC30EB1E5EB7697BFE7515DCA2BA575838EFF29F7E4BA1F56C1BB8F0A421035F44918728236654AEC5812EEDFB330417D20C"
    }

Result from the same block using fetchAccount():

{ type: 'state',
  account: 'ed506ad4a0bf811e69ddb1f2fe5dc28abc0d4d9817ec246fd9915aa7e933c7b3',
  previous: '27062303e310f7541e89cb3cf5e6436adfeff80f70c5a7e31ff9ddb2bd9f0415',
  representative: 'ae7ac63990daaaf2a69bf11c913b928844bf5012355456f2f164166464024b29',
  balance: '3262708019134565000000000000',
  link: 'd13b986a0cf2bc94d5ca0082481e183da46fe4563062cf3343ebdf6868081198',
  hash: 'f2bf3d8e6f571d0fa1b95c62fa2dfb391c725a49b22774532b5aae241f4bc683',
  signature: '185b9b69cad6e005063e7a676111ec30eb1e5eb7697bfe7515dca2ba575838eff29f7e4ba1f56c1bb8f0a421035f44918728236654aec5812eedfb330417d20c',
  work: '0000000005a1fa29' }

As you can see the work, signature, link, previous values are the same; but the hash values are different? Do you have any clue as to why this would be? Is there some kind of encoding happening?

Thanks in advance

thegafo avatar Sep 06 '18 23:09 thegafo