[SON for Hive] - Fix asset_symbol_type serialization
Comparing Hive wallet and SON for Hive transaction processing, we do have exactly the same string representation of the transactions:
Hive
{"ref_block_num":42214,"ref_block_prefix":2560592527,"expiration":"2021-04-26T10:38:51","operations":[{"type":"transfer_operation","value":{"from":"sonaccount01","to":"account05","amount":{"amount":"1000","precision":3,"nai":"@@000000021"},"memo":""}}],"extensions":[],"signatures":[]}
SON
{"ref_block_num":42214,"ref_block_prefix":2560592527,"expiration":"2021-04-26T10:38:51","operations":[{"type":"transfer_operation","value":{"from":"sonaccount01","to":"account05","amount":{"amount":"1000","precision":3,"nai":"@@000000021"},"memo":""}}],"extensions":[],"signatures":[]}
When we serialize transaction for signing, we get different binary representations
Hive
E6A48F8A9F983B98866001020C736F6E6163636F756E743031096163636F756E743035E8030000000000000354455354530000000000
SON
E6A48F8A9F983B98866001020C736F6E6163636F756E743031096163636F756E743035E8030000000000002320BCBE000000
Dissected, this is the binary layout
Hive:
E6A4 8F8A9F98 3B98866001 02 0C736F6E6163636F756E743031 09 6163636F756E743035 E803000000000000 0354455354530000 000000
E6A4 ref_block_num
8F8A9F98 ref_block_prefix
3B98866001 expiration
02 operation identifier (transfer)
0C736F6E6163636F756E743031 from (string of length 13 (0C), this is actually sonaccount01 in hex)
096163636F756E743035 to (string of length 9 (09), this is actually account05 in hex)
E803000000000000 amount.amount, 1000 in hex, 64 bit
0354455354530000 this is asset identifier, 03 - precision and TESTS in hex
000000 ???
SON:
E6A4 8F8A9F98 3B98866001 02 0C736F6E6163636F756E743031 09 6163636F756E743035 E803000000000000 2320BCBE000000
E6A4 ref_block_num
8F8A9F98 ref_block_prefix
3B98866001 expiration
02 operation identifier (transfer)
0C736F6E6163636F756E743031 from (string of length 13 (0C), this is actually sonaccount01 in hex)
096163636F756E743035 to (string of length 9 (09), this is actually account05 in hex)
E803000000000000 amount.amount, 1000 in hex, 64 bit
2320BCBE000000 incorrectly serialized asset_symbol_type
There are pack/unpack functions here: !13 (diffs)
which should handle asset_symbol_type serialization, but for some reason fc lib does not picks it for serialization.