I am having an issue trying to verify ecdsa signature in ink! for my test.
I am generating the signature this way
const keyring = new Keyring({type: 'ecdsa'});
const pair = keyring.addFromUri('//Alice');
Then i get the public key to be stored in the contract storage as the governor during instantiation of the contract
const publicKey = pair.publicKey;
This is how i am signing the message(data)
const sig = Array.from(pair.sign(hashDataArray));
Then i pass the signature into the contract.
But when i call ink_env::ecdsa_recover
in the contract to recover the public key from the signature, i get a different public key entirely different from the one i stored(generated) in the contract during instantiation.