-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving validation check for transaction #145
Comments
Here is the sample code i wrote.
|
I use this sequence to send a txn and it works: console.log("sending transaction:", tx)
tx.sign = await crypto.signTransaction(tx, account.keyPair);
tx.hash = await crypto.hashTransaction(tx, 'bytes');
const txhash = await aergo.sendSignedTransaction(tx);
const receipt = await aergo.waitForTransactionReceipt(txhash);
console.log("transaction receipt:", receipt) |
@kroggen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A digital signature is required for Argo's transactions, but when calling
hashTransaction
, it calculate without a error, assuming a digital signature is empty. If this transaction with wrong calculated invalid hash is sent to the server, the server returns a TX_INVALID_HASH error because the server calculates the hash value including the signature. I know tt is actually user's fault, but I think it would be better to do more detailed and kind validation at the SDK level. This validation will prevent both the client and the server from unnecessary loads.And if the transaction without digital signature is sent,
UNDEFINED_ERROR: malformed signature: too short
error is returned. In this case as well, I think it would be better if the herajs check it before sending it to the server and send it.The text was updated successfully, but these errors were encountered: