Is this expected Behaviour in /v0/send-bitclout?
I was running bit clout on my local machine in TESTNET mode, and i am trying out different API's from Backend API List through postman. Everything is working great when i call
api/v0/send-bitclout
I get an response, but immediately when i try to call next API
api/v0/submit-transaction
with transactionhex as input
i am getting
{ "error": "SubmitTransaction: Problem processing transaction: VerifyAndBroadcastTransaction: Problem validating txn: ValidateTransaction: Problem validating transaction: : ConnectTransaction: : _connectBasicTransfer: Problem verifying txn signature: : RuleErrorInvalidTransactionSignature" }
when try to log few transaction data on my console i noticed below output is getting printed:
< TxHash: f285f5199b27eac5f40e9b2d194628c3d3d2612b667e4bd5a496e7e264c95c2e, TxnType: BC1YLgJxJq5BHAMhmcWjAxKjphgXE7fogodt1RDk9jhGWTLPz1j3qHP, PubKey: BASIC_TRANSFER >
here you can see
PubKey -> is having transaction type value and TxnType is having public key
it just swapped the data which is strange, i don't understand how this is happening? can someone shed some light here please?
Above log is printed when calling "/send-bitclout" API, inside "SendBitClout" method call -> above line #987. File: routes/transaction.go#L987
Did you sign the transaction hex before sending it to submit-transaction, or just lift it directly off the send-bitclout response?
Did you sign the transaction hex before sending it to
submit-transaction, or just lift it directly off thesend-bitcloutresponse?
That's the exact issue.. Thanks for pointing out.. :) Just figured out by running frontend on my local machine. Everything works smooth.. but i still don't get why the keys are swapped?
My guess is that's a typo in the logging code somewhere, it definitely shouldn't be like that.
I am not doing anything extra here! i am just printing txnn.. glog.Infof("========raw data Just before Sanity check=========: %v", txnn)
The transaction String() method has these parameters swapped. It's an easy fix in the core repo if you want to try it :)