Signature Verification Using Go-SDK #572
Replies: 1 comment
-
JUST SERIALIZE YOUR ARGUMENTS BEFORE SENDING THEM
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Discord user ID
No response
Describe your question in detail.
Hey there everyone!!!
I'm trying to perform signature verification, using go-sdk
For that i have deployed a contract with a method as
`#[view]
public fun verify(
message_hash: vector, signature: vector, pub_key: vector
): bool {
let signature_ed = ed25519::new_signature_from_bytes(signature);
);
let msgBytes = msg.bcsToBytes();
let msgHash = sha256(msgBytes);
console.log(msgHash);
let signedHash = signMessage(onweAcc.privateKey, msgHash);
const payload: InputViewFunctionData = {
function:
${onweAcc.accountAddress.toString()}::verify_signature::verify
,functionArguments: [
msgHash,
signedHash.toUint8Array(),
onweAcc.publicKey.toUint8Array(),
],
};
const result = await aptos.view({ payload });
console.log(result[0]);`
But when I'm trying to invoke the same method using go-sdk is giving me error saying failed to deseriealize the argument
`txMsg := utils.MoveMessageStruct{
Name: "Rkoranne0755",
Address: admin.Address,
Age: 25,
Storage: []uint64{1, 2, 3, 4, 5},
}
msgBytes := txMsg.Serialize()
msgHash := sha256.Sum256(msgBytes)
What error, if any, are you getting?
Errorview function api err: HttpError POST "https://api.devnet.aptoslabs.com/v1/view" -> "400 Bad Request" "{"message":"PartialVMError with status FAILED_TO_DESERIALIZE_ARGUMENT","error_code":"invalid_input","vm_error_code":null}"
What have you tried or looked at? Or how can we reproduce the error?
No response
Which operating system are you using?
Linux (Ubuntu, Fedora, Windows WSL, etc.)
Which SDK or tool are you using? (if any)
N/A
Describe your environment or tooling in detail
No response
Beta Was this translation helpful? Give feedback.
All reactions