fix: some wallet default config fixes after rebase

This commit is contained in:
Daniil Polyakov 2026-03-20 01:21:50 +03:00
parent 7b50c68550
commit 3913446cd2
2 changed files with 336 additions and 336 deletions

View File

@ -19,7 +19,7 @@
},
{
"Private": {
"account_id": "HWkW5qd4XK3me6sCAb4bfPj462k33DjtKtEcYpuzNwB",
"account_id": "9DGDXnrNo4QhUUb2F8WDuDrPESja3eYDkZG5HkzvAvMC",
"account": {
"program_owner": [
0,
@ -37,184 +37,184 @@
},
"key_chain": {
"secret_spending_key": [
14,
202,
241,
109,
32,
181,
152,
140,
76,
153,
108,
57,
77,
192,
181,
97,
108,
75,
231,
144,
122,
45,
219,
165,
5,
203,
193,
36,
183,
237,
190,
227,
238,
13,
132,
39,
114,
228,
172,
82,
123,
83,
34,
250,
214,
137,
63
119,
164,
233,
132,
130,
224,
201,
90,
200,
156,
108,
199,
56,
22
],
"private_key_holder": {
"nullifier_secret_key": [
174,
56,
101,
30,
248,
249,
100,
0,
122,
199,
209,
246,
58,
163,
223,
146,
59,
143,
78,
95,
41,
186,
106,
187,
53,
63,
75,
244,
233,
185,
110,
199
212,
34,
166,
184,
182,
77,
127,
176,
147,
68,
148,
190,
41,
244,
8,
202,
51,
10,
44,
43,
93,
41,
229,
130,
54,
96,
198,
242,
10,
227,
119,
1
],
"viewing_secret_key": [
251,
85,
223,
73,
142,
127,
134,
132,
185,
210,
100,
103,
198,
108,
229,
80,
176,
211,
249,
114,
110,
7,
225,
17,
7,
69,
204,
32,
47,
242,
103,
247
205,
10,
5,
19,
148,
98,
49,
19,
251,
186,
247,
216,
75,
53,
184,
36,
84,
87,
236,
205,
105,
217,
213,
21,
61,
183,
133,
174,
121,
115,
51,
203
]
},
"nullifier_public_key": [
139,
19,
158,
11,
155,
231,
85,
206,
132,
228,
220,
114,
145,
89,
122,
213,
113,
156,
238,
142,
242,
74,
182,
91,
43,
8,
118,
179,
235,
94,
5,
219,
131,
106,
246,
253,
14,
204,
65,
93,
0,
198,
100,
108,
57,
48,
6,
190,
65,
183,
31,
15,
31,
88,
96,
204
136,
86,
82,
165
],
"viewing_public_key": [
3,
136,
153,
50,
191,
184,
135,
36,
29,
107,
57,
9,
218,
135,
249,
213,
118,
165,
235,
215,
118,
173,
30,
137,
116,
77,
17,
86,
62,
154,
31,
173,
4,
19,
45,
0,
27,
18,
26,
11,
226,
126,
174,
144,
167,
211
160,
199,
14,
23,
49,
163,
49,
138,
129,
229,
79,
9,
15,
234,
30
]
}
}
},
{
"Private": {
"account_id": "HUpbRQ1vEcZv5y6TDYv9tpt1VA64ji2v4RDLJfK2rpZn",
"account_id": "A6AT9UvsgitUi8w4BH43n6DyX1bK37DtSCfjEWXQQUrQ",
"account": {
"program_owner": [
0,
@ -232,181 +232,180 @@
},
"key_chain": {
"secret_spending_key": [
32,
107,
49,
136,
174,
162,
244,
221,
2,
133,
168,
107,
250,
240,
52,
92,
187,
157,
116,
249,
203,
143,
194,
214,
112,
115,
142,
105,
252,
146,
166,
197,
163,
132,
153,
78,
241,
173,
103,
242,
192,
196,
29,
133
222,
68,
17,
87,
101,
22,
113,
88,
97,
180,
203,
139,
18,
28,
62,
51,
149
],
"private_key_holder": {
"nullifier_secret_key": [
188,
235,
121,
54,
131,
206,
7,
215,
94,
231,
102,
22,
12,
27,
253,
161,
248,
206,
41,
160,
206,
149,
5,
217,
127,
235,
154,
230,
198,
232,
102,
31
219,
5,
233,
185,
144,
150,
100,
58,
97,
5,
57,
163,
110,
46,
241,
216,
155,
217,
100,
51,
184,
21,
225,
148,
198,
9,
121,
239,
232,
98,
22,
218
],
"viewing_secret_key": [
89,
116,
140,
122,
211,
179,
190,
229,
18,
94,
56,
235,
48,
99,
104,
228,
111,
72,
231,
18,
247,
97,
110,
60,
238,
138,
0,
25,
92,
44,
30,
145
35,
105,
230,
121,
218,
177,
21,
55,
83,
80,
95,
235,
161,
83,
11,
221,
67,
83,
1,
218,
49,
242,
53,
29,
26,
171,
170,
144,
49,
233,
159,
48
]
},
"nullifier_public_key": [
173,
134,
33,
223,
54,
226,
10,
71,
215,
254,
143,
172,
24,
244,
68,
229,
154,
12,
235,
210,
229,
236,
144,
126,
122,
58,
107,
36,
58,
243,
208,
65,
112,
118,
70,
217,
240,
69,
100,
129,
3,
121,
25,
213,
132,
42,
45
128,
174,
197,
141,
137,
162,
190,
155,
234,
94,
156,
218,
34,
13,
221
],
"viewing_public_key": [
2,
43,
42,
253,
112,
83,
195,
164,
26,
141,
92,
28,
224,
120,
155,
119,
225,
1,
45,
42,
245,
172,
3,
122,
7,
137,
250,
84,
10,
85,
3,
15,
134,
136,
52,
183,
170,
96,
115,
212,
114,
250,
205,
40,
126,
211,
14,
120,
37
15,
55,
56,
214,
72,
243,
83,
17,
124,
242,
251,
184,
174,
150,
83
]
}
}
}
],
"basic_auth": null
]
}

View File

@ -2,7 +2,6 @@ use std::{
collections::HashMap,
io::{BufReader, Write as _},
path::Path,
str::FromStr as _,
time::Duration,
};
@ -207,6 +206,28 @@ pub struct WalletConfig {
impl Default for WalletConfig {
fn default() -> Self {
let pub_sign_key1 = nssa::PrivateKey::try_new([
127, 39, 48, 152, 242, 91, 113, 230, 192, 5, 169, 81, 159, 38, 120, 218, 141, 28, 127,
1, 246, 162, 119, 120, 226, 217, 148, 138, 189, 249, 1, 251,
])
.unwrap();
let public_key1 = nssa::PublicKey::new_from_private_key(&pub_sign_key1);
let public_account_id1 = nssa::AccountId::from(&public_key1);
let pub_sign_key2 = nssa::PrivateKey::try_new([
244, 52, 248, 116, 23, 32, 1, 69, 134, 174, 67, 53, 109, 42, 236, 98, 87, 218, 8, 98,
34, 246, 4, 221, 183, 93, 105, 115, 59, 134, 252, 76,
])
.unwrap();
let public_key2 = nssa::PublicKey::new_from_private_key(&pub_sign_key2);
let public_account_id2 = nssa::AccountId::from(&public_key2);
let key_chain1 = KeyChain::new_mnemonic("default_private_account_1".to_owned());
let private_account_id1 = nssa::AccountId::from(&key_chain1.nullifier_public_key);
let key_chain2 = KeyChain::new_mnemonic("default_private_account_2".to_owned());
let private_account_id2 = nssa::AccountId::from(&key_chain2.nullifier_public_key);
Self {
sequencer_addr: "http://127.0.0.1:3040".parse().unwrap(),
seq_poll_timeout: Duration::from_secs(12),
@ -216,48 +237,28 @@ impl Default for WalletConfig {
basic_auth: None,
initial_accounts: vec![
InitialAccountData::Public(InitialAccountDataPublic {
account_id: nssa::AccountId::from_str(
"CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r",
)
.unwrap(),
pub_sign_key: nssa::PrivateKey::try_new([
127, 39, 48, 152, 242, 91, 113, 230, 192, 5, 169, 81, 159, 38, 120, 218,
141, 28, 127, 1, 246, 162, 119, 120, 226, 217, 148, 138, 189, 249, 1, 251,
])
.unwrap(),
account_id: public_account_id1,
pub_sign_key: pub_sign_key1,
}),
InitialAccountData::Public(InitialAccountDataPublic {
account_id: nssa::AccountId::from_str(
"7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo",
)
.unwrap(),
pub_sign_key: nssa::PrivateKey::try_new([
244, 52, 248, 116, 23, 32, 1, 69, 134, 174, 67, 53, 109, 42, 236, 98, 87,
218, 8, 98, 34, 246, 4, 221, 183, 93, 105, 115, 59, 134, 252, 76,
])
.unwrap(),
account_id: public_account_id2,
pub_sign_key: pub_sign_key2,
}),
InitialAccountData::Private(Box::new(InitialAccountDataPrivate {
account_id: nssa::AccountId::from_str(
"HWkW5qd4XK3me6sCAb4bfPj462k33DjtKtEcYpuzNwB",
)
.unwrap(),
account_id: private_account_id1,
account: nssa::Account {
balance: 10_000,
..Default::default()
},
key_chain: KeyChain::new_mnemonic("default_private_account_1".to_owned()),
key_chain: key_chain1,
})),
InitialAccountData::Private(Box::new(InitialAccountDataPrivate {
account_id: nssa::AccountId::from_str(
"HUpbRQ1vEcZv5y6TDYv9tpt1VA64ji2v4RDLJfK2rpZn",
)
.unwrap(),
account_id: private_account_id2,
account: nssa::Account {
balance: 20_000,
..Default::default()
},
key_chain: KeyChain::new_mnemonic("default_private_account_2".to_owned()),
key_chain: key_chain2,
})),
],
}