elesto-dao / elesto

The ElestoDAO node
Apache License 2.0
4 stars 1 forks source link

code 111222 when providing wrong PubKey type #172

Open 0xArdi opened 2 years ago

0xArdi commented 2 years ago

Providing a PubKey of type ed25519 on a SignatureV2 object and broadcasting the transaction the signature belongs to results in a code: 111222.

An example signature resulting in code 111222:

signing.SignatureV2{
    PubKey:   &secp256k1.PubKey{Key: val.PubKey.Bytes()}, // <------ passing an ed25519 pubkey, a secp256k1 pubkey is expected
    Data:     &sigData,
    Sequence: baseAccount.Sequence,
}

To run an example of this checkout #171

The error doesn't occur without explicitly casting the ed25519 PubKey into a secp256k1 one. The following code produces the correct error (code 8):

signing.SignatureV2{
    PubKey:   val.PubKey, // <------ passing an ed25519 pubkey, a secp256k1 pubkey is expected
    Data:     &sigData,
    Sequence: baseAccount.Sequence,
}
github-actions[bot] commented 2 years ago

This issue was marked as stale because there was no activity for 15 days