diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2021-08-20 13:54:43 +0000 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2021-08-20 13:54:43 +0000 |
| commit | c05487949a5cb9808945b5bdd174e14fdd7e51ea (patch) | |
| tree | 8d51bbe6968aae3bd99f8664f31214e84464c64d /src/account.rs | |
| parent | f2817a2f4db1eb23fb6f422b937e161324a35d54 (diff) | |
Add support for multiple transaction formats
Additionally, transaction signing is now from file instead of being from command line arguments
Diffstat (limited to 'src/account.rs')
| -rw-r--r-- | src/account.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/account.rs b/src/account.rs index 511d6aa..eda93bf 100644 --- a/src/account.rs +++ b/src/account.rs @@ -5,7 +5,7 @@ mod signature; pub use self::{ address::Address, - signature::{Parity, Signature}, + signature::{Signature, YParity}, }; use crate::hash; use anyhow::Result; @@ -65,8 +65,8 @@ impl PrivateKey { Signature { y_parity: match recovery_id.to_i32() { - 0 => Parity::Even, - 1 => Parity::Odd, + 0 => YParity::Even, + 1 => YParity::Odd, n => unreachable!("non 0 or 1 signature y-parity bit {}", n), }, r: raw_signature[..32].try_into().unwrap(), @@ -109,7 +109,7 @@ mod tests { assert_eq!( key.sign(message), Signature { - y_parity: Parity::Odd, + y_parity: YParity::Odd, r: hex!("408790f153cbfa2722fc708a57d97a43b24429724cf060df7c915d468c43bd84"), s: hex!("61c96aac95ce37d7a31087b6634f4a3ea439a9f704b5c818584fa2a32fa83859"), }, |
