uuosio / ascdk

MIT License
12 stars 9 forks source link

U256 Secondary key does not match EOSIO SDK #85

Open metallicusdev opened 1 year ago

metallicusdev commented 1 year ago

In EOSIO SDK, idx256 is stored differently than ascdk

example:

actual data stored using ascdk: efbb5450f4528e0dd33ff1873f52a175 e8f280eb591c6725a1227b9aec8eac0e

to fetch from get_table_rows in ascdk contract, we have to instead use the key 75a1523f87f13fd30d8e52f45054bbef 0eac8eec9a7b22a125671c59eb80f2e8

learnforpractice commented 1 year ago

Fix by 143937ca246676df23d952a505b82791b43db17c. Keep in mind this is a breaking change.

metallicusdev commented 1 year ago

Is it necessary to change the packing / unpacking? The previous packed seems to be correct, just issue on the secondary index

learnforpractice commented 1 year ago

the checksum256 in C++ is in big endian, see fixed_bytes in libraries/eosiolib/core/eosio/fixed_bytes.hpp