EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.28k stars 3.6k forks source link

New set/get_parameters follow the design document format. #10974

Closed softprofe closed 2 years ago

softprofe commented 2 years ago

For epe 665, the new set/get_parameters follow the design document format, so fix the compatible problem

https://developers.eos.io/manuals/eos/latest/classeosio_1_1chain_1_1webassembly_1_1interface#function-set_parameters_packed

buffer is a packed data stream which represents an encoded sequence of parameter_id:paramter_value pairs with the following format: |varuint32:sequence_length | varuint32:parameter_id | :parameter_value | ...

And this change was tested to be works perfect with new cdt PR https://github.com/EOSIO/eosio.cdt/pull/1254/

cleos -v push action eosio get '[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]]' -p eosio@active executed transaction: 714d42fb2c5cf023b4d9c5cfcb153e2df9c64f5b1ad7a90fb72eff882ab5e63b 168 bytes 786 us

eosio <= eosio::get {"param_ids":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]}

=> return value: [{"first":0,"second":["uint64",1048800]},{"first":1,"second":["uint32",1008]},{"first":2,"second":["...

id = 0, value= 1048800 id = 1, value= 1008 id = 2, value= 524290 id = 3, value= 12 id = 4, value= 500 id = 5, value= 20 id = 6, value= 100 id = 7, value= 200000 id = 8, value= 1000 id = 9, value= 150000 id = 10, value= 100 id = 11, value= 3600 id = 12, value= 600 id = 13, value= 3888000 id = 14, value= 524288 id = 15, value= 5 id = 16, value= 7 id = 17, value= 256

Change Description

Change Type

Select ONE:

Testing Changes

Select ANY that apply:

Consensus Changes

API Changes

Documentation Additions

========================================================================= As the eos host function was already released no easy to change, so I just did some adaption in cdt part, and now the cdt part works well without eos part change, so this PR is not needed anymore, just close it, and sorry for bothering the reviewers.

softprofe commented 2 years ago

As the eos host function was already released it's not easy to change, so I just did some adaption in cdt part, and now the cdt part works well without eos part change, so this PR is not needed anymore, just close it, and sorry for bothering the reviewers.