diff --git a/src/message.cpp b/src/message.cpp index 925d6158..f404da31 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -102,6 +102,8 @@ void Message::merge_account_meta(const AccountMeta &account_meta){ } void Message::merge_signer(const Variant& signer){ + ERR_FAIL_COND_EDMSG(Pubkey::is_pubkey(signer), "Pubkey is provided as signing parameter. (Use Keypair or WalletAdapter.)"); + for(unsigned int i = 0; i < signers.size(); i++){ if(Pubkey::bytes_from_variant(signers[i]) == Pubkey::bytes_from_variant(signer)){ return; diff --git a/src/transaction.cpp b/src/transaction.cpp index b64838a7..d511bc4d 100644 --- a/src/transaction.cpp +++ b/src/transaction.cpp @@ -487,6 +487,7 @@ PackedByteArray Transaction::serialize_signers(){ } Variant Transaction::sign_and_send(){ + ERR_FAIL_COND_V_EDMSG(Object::cast_to(message)->get_signers().size() != signatures.size(), Error::ERR_UNCONFIGURED ,"Transaction does not have enough signers."); connect("fully_signed", Callable(this, "send_and_disconnect")); sign(); @@ -525,6 +526,9 @@ void Transaction::blockhash_callback(Dictionary params){ void Transaction::send(){ ERR_FAIL_COND_EDMSG(!is_inside_tree(), "Transaction node must be added to scene tree."); + + ERR_FAIL_COND_EDMSG(Object::cast_to(message)->get_signers().size() != signatures.size(), "Transaction does not have enough signers."); + PackedByteArray serialized_bytes = serialize(); Callable pending_blockhash_callback(this, "send");