aitos-io / BoAT-X-Framework

BoAT-X Blockchain Application Framework for IoT
http://www.aitos.io
Apache License 2.0
926 stars 49 forks source link

platone my_contract_cpp_abi_setName parameters should judgment msg parameter is empty #1313

Open Cavalierliu opened 1 year ago

Cavalierliu commented 1 year ago

BCHAR my_contract_cpp_abi_setName(BoatPlatoneTx tx_ptr, BCHAR msg) { static BCHAR tx_hash_str[67] = ""; BoatFieldVariable data_field; RlpEncodedStreamObject rlp_stream_ptr; RlpObject rlp_object_list; RlpObject rlp_object_txtype; BUINT64 txtype; RlpObject rlp_object_string_func_name; RlpObject rlp_object_string_msg; boat_try_declare;

boat_try(BoatPlatoneTxSetNonce(tx_ptr, BOAT_PLATONE_NONCE_AUTO));

boat_try(RlpInitListObject(&rlp_object_list));

txtype = tx_ptr->rawtx_fields.txtype;
boat_try(RlpInitStringObject(&rlp_object_txtype, UtilityChangeEndian(&txtype, sizeof(txtype)), sizeof(txtype)));
boat_try(0 > RlpEncoderAppendObjectToList(&rlp_object_list, &rlp_object_txtype));

boat_try(RlpInitStringObject(&rlp_object_string_func_name, (BUINT8*)"setName", strlen("setName")));
boat_try(0 > RlpEncoderAppendObjectToList(&rlp_object_list, &rlp_object_string_func_name));

boat_try(RlpInitStringObject(&rlp_object_string_msg, (BUINT8*)msg, strlen(msg)));
boat_try(0 > RlpEncoderAppendObjectToList(&rlp_object_list, &rlp_object_string_msg));