darth-cy / walletcryptography

6 stars 1 forks source link

an error i `secp256k1_add_poins` and `secp256k1_double_point` test #1

Open porco-rosso-j opened 4 months ago

porco-rosso-j commented 4 months ago

These tests fail due to the format method, which adds a "04" value and doesn't have a space between x and y in to_hex_string().

---- secp256k1::tests::secp256k1_add_poins stdout ----
thread 'secp256k1::tests::secp256k1_add_poins' panicked at src/secp256k1.rs:160:9:
assertion `left == right` failed
  left: "04f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"
 right: "f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9 388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"

I'm not sure why it succeeds on your end in the video, but here is the modification to to_hex_string() that resolves the issue:

return format!("{}{}{}", self.x.to_string(), " ", self.y.to_string());

my environment

porco-rosso-j commented 4 months ago

Forgot to mention: awesome content! Appreciate your work.