penumbra_sdk_keys/
test_keys.rs

1//! Hardcoded test keys used by the `Default` genesis state and test code.
2
3use once_cell::sync::Lazy;
4
5use crate::{
6    keys::{Bip44Path, SpendKey, WalletId},
7    Address, FullViewingKey,
8};
9
10/// This address is for test purposes, allocations were added beginning with
11/// the 062-Iapetus testnet.
12/// Previously the test data was generated using BIP39 derivation starting with
13/// the 016-Pandia testnet.
14pub const SEED_PHRASE: &str = "comfort ten front cycle churn burger oak absent rice ice urge result art couple benefit cabbage frequent obscure hurry trick segment cool job debate";
15
16/// These addresses both correspond to the test wallet above.
17pub const ADDRESS_0_STR: &str = "penumbra147mfall0zr6am5r45qkwht7xqqrdsp50czde7empv7yq2nk3z8yyfh9k9520ddgswkmzar22vhz9dwtuem7uxw0qytfpv7lk3q9dp8ccaw2fn5c838rfackazmgf3ahh09cxmz";
18/// These addresses both correspond to the test wallet above.
19pub const ADDRESS_1_STR: &str = "penumbra1vmmz304hjlkjq6xv4al5dqumvgk3ek82rneagj07vdqkudjvl6y7zxzr5k6qq24yc7yyyekpu9qm7ef3acg2u8p950hs6hu3e73guq5pfmmvm63qudfx4qmg8h7fdweyw3ektn";
20
21pub static ADDRESS_0: Lazy<Address> = Lazy::new(|| {
22    ADDRESS_0_STR
23        .parse()
24        .expect("hardcoded test addresses should be valid")
25});
26pub static ADDRESS_1: Lazy<Address> = Lazy::new(|| {
27    ADDRESS_1_STR
28        .parse()
29        .expect("hardcoded test addresses should be valid")
30});
31
32/// The test account's spend key.
33pub static SPEND_KEY: Lazy<SpendKey> = Lazy::new(|| {
34    SpendKey::from_seed_phrase_bip44(
35        SEED_PHRASE
36            .parse()
37            .expect("hardcoded test seed phrase should be valid"),
38        &Bip44Path::new(0),
39    )
40});
41
42/// The test account's full viewing key, as a string.
43pub const FULL_VIEWING_KEY_STR: &str = "penumbrafullviewingkey1vzfytwlvq067g2kz095vn7sgcft47hga40atrg5zu2crskm6tyyjysm28qg5nth2fqmdf5n0q530jreumjlsrcxjwtfv6zdmfpe5kqsa5lg09";
44
45/// The test account's full viewing key.
46pub static FULL_VIEWING_KEY: Lazy<FullViewingKey> = Lazy::new(|| {
47    FULL_VIEWING_KEY_STR
48        .parse()
49        .expect("hardcoded test fvk should be valid")
50});
51
52pub static WALLET_ID: Lazy<WalletId> = Lazy::new(|| FULL_VIEWING_KEY.wallet_id());
53
54#[cfg(test)]
55mod tests {
56    use super::*;
57
58    #[test]
59    fn test_fvk_matches() {
60        assert_eq!(*FULL_VIEWING_KEY, *SPEND_KEY.full_viewing_key());
61    }
62}