@@ -102,7 +102,6 @@ impl Hashable for SnappAccount {
102
102
roi = roi. append_field ( * field) ;
103
103
}
104
104
105
- // elog!("ROInput={:?}", roi);
106
105
107
106
roi
108
107
}
@@ -126,10 +125,6 @@ pub struct AccountLegacy {
126
125
pub timing : Timing , // Timing.t
127
126
pub permissions : PermissionsLegacy < AuthRequired > , // Permissions.t
128
127
pub snap : Option < SnappAccount > ,
129
- // Below fields are for `develop` branch
130
- // pub token_symbol: TokenSymbol, // Token_symbol.t
131
- // pub zkapp: Option<ZkAppAccount>, // Zkapp_account.t
132
- // pub zkapp_uri: String, // string
133
128
}
134
129
135
130
pub fn get_legacy_hash_of < T : Hashable > ( init_value : T :: D , item : & T ) -> Fp {
@@ -144,21 +139,6 @@ impl Hashable for AccountLegacy {
144
139
fn to_roinput ( & self ) -> ROInput {
145
140
let mut roi = ROInput :: new ( ) ;
146
141
147
- // Self::token_symbol
148
-
149
- // https://github.com/MinaProtocol/mina/blob/2fac5d806a06af215dbab02f7b154b4f032538b7/src/lib/mina_base/account.ml#L97
150
- // assert!(self.token_symbol.len() <= 6);
151
-
152
- // if !self.token_symbol.is_empty() {
153
- // let mut s = <[u8; 6]>::default();
154
- // let len = self.token_symbol.len();
155
-
156
- // s[..len].copy_from_slice(&self.token_symbol.as_bytes());
157
- // roi.append_bytes(self.token_symbol.as_bytes());
158
- // } else {
159
- // roi.append_bytes(&[0; 6]);
160
- // }
161
-
162
142
// Self::snapp
163
143
let snapp_accout = match self . snap . as_ref ( ) {
164
144
Some ( snapp) => Cow :: Borrowed ( snapp) ,
@@ -168,7 +148,6 @@ impl Hashable for AccountLegacy {
168
148
169
149
roi = roi. append_field ( snapp_digest) ;
170
150
171
- // elog!("ROINPUT={:?}", roi);
172
151
173
152
// Self::permissions
174
153
for auth in [
@@ -260,142 +239,16 @@ impl Hashable for AccountLegacy {
260
239
roi
261
240
}
262
241
263
- // fn to_roinput(&self) -> ROInput {
264
- // let mut roi = ROInput::new();
265
-
266
- // // Self::public_key
267
- // roi.append_field(self.public_key.x);
268
- // roi.append_bool(self.public_key.is_odd);
269
-
270
- // // Self::token_id
271
- // roi.append_u64(self.token_id.0);
272
-
273
- // // Self::token_permissions
274
- // match self.token_permissions {
275
- // TokenPermissions::TokenOwned { disable_new_accounts } => {
276
- // roi.append_bool(true);
277
- // roi.append_bool(disable_new_accounts);
278
- // },
279
- // TokenPermissions::NotOwned { account_disabled } => {
280
- // roi.append_bool(false);
281
- // roi.append_bool(account_disabled);
282
- // },
283
- // }
284
-
285
- // // Self::balance
286
- // roi.append_u64(self.balance);
287
-
288
- // // Self::token_symbol
289
-
290
- // // https://github.com/MinaProtocol/mina/blob/2fac5d806a06af215dbab02f7b154b4f032538b7/src/lib/mina_base/account.ml#L97
291
- // // assert!(self.token_symbol.len() <= 6);
292
-
293
- // // if !self.token_symbol.is_empty() {
294
- // // let mut s = <[u8; 6]>::default();
295
- // // let len = self.token_symbol.len();
296
-
297
- // // s[..len].copy_from_slice(&self.token_symbol.as_bytes());
298
- // // roi.append_bytes(self.token_symbol.as_bytes());
299
- // // } else {
300
- // // roi.append_bytes(&[0; 6]);
301
- // // }
302
-
303
- // // Self::nonce
304
- // roi.append_u32(self.nonce);
305
-
306
- // // Self::receipt_chain_hash
307
- // roi.append_field(self.receipt_chain_hash.0);
308
-
309
- // // Self::delegate
310
- // match self.delegate.as_ref() {
311
- // Some(delegate) => {
312
- // roi.append_field(delegate.x);
313
- // roi.append_bool(delegate.is_odd);
314
- // },
315
- // None => {
316
- // // Public_key.Compressed.empty
317
- // roi.append_field(Fp::zero());
318
- // roi.append_bool(false);
319
- // },
320
- // }
321
-
322
- // // Self::voting_for
323
- // roi.append_field(self.voting_for.0);
324
-
325
- // // Self::timing
326
- // match self.timing {
327
- // Timing::Untimed => {
328
- // roi.append_bool(false);
329
- // roi.append_u64(0); // initial_minimum_balance
330
- // roi.append_u32(0); // cliff_time
331
- // roi.append_u64(0); // cliff_amount
332
- // roi.append_u32(1); // vesting_period
333
- // roi.append_u64(0); // vesting_increment
334
- // },
335
- // Timing::Timed { initial_minimum_balance, cliff_time, cliff_amount, vesting_period, vesting_increment } => {
336
- // roi.append_bool(true);
337
- // roi.append_u64(initial_minimum_balance);
338
- // roi.append_u32(cliff_time);
339
- // roi.append_u64(cliff_amount);
340
- // roi.append_u32(vesting_period);
341
- // roi.append_u64(vesting_increment);
342
- // },
343
- // }
344
-
345
- // // Self::permissions
346
- // for auth in [
347
- // self.permissions.set_verification_key,
348
- // self.permissions.set_permissions,
349
- // self.permissions.set_delegate,
350
- // self.permissions.receive,
351
- // self.permissions.send,
352
- // self.permissions.edit_state,
353
- // ] {
354
- // for bit in auth.encode().to_bits() {
355
- // roi.append_bool(bit);
356
- // }
357
- // }
358
- // roi.append_bool(self.permissions.stake);
359
-
360
- // // Self::snapp
361
- // let snapp_accout = match self.snap.as_ref() {
362
- // Some(snapp) => Cow::Borrowed(snapp),
363
- // None => Cow::Owned(SnappAccount::default()),
364
- // };
365
- // let mut hasher = create_legacy::<SnappAccount>(());
366
- // hasher.update(snapp_accout.as_ref());
367
- // let snapp_digest = hasher.digest();
368
-
369
- // roi.append_field(snapp_digest);
370
-
371
- // elog!("ROINPUT={:?}", roi);
372
-
373
- // roi
374
- // }
375
-
376
242
fn domain_string ( _: ( ) ) -> Option < String > {
377
243
Some ( "CodaAccount*********" . to_string ( ) )
378
244
}
379
245
}
380
246
381
- // mina_hasher::poseidon::
382
-
383
247
impl AccountLegacy {
384
248
pub fn create ( ) -> Self {
385
- // use o1_utils::field_helpers::FieldHelpers;
386
-
387
- // let token_id = bs58::decode("wSHV2S4qX9jFsLjQo8r1BsMLH2ZRKsZx6EJd1sbozGPieEC4Jf").into_vec().unwrap();
388
- // let token_id = Fp::from_bytes(&token_id).unwrap();
389
-
390
- // elog!("token_id={:?}", token_id.to_string());
391
-
392
- // let t = bs58::encode(token_id).into_string();
393
- // let t = bs58::encode(token_id.to_bytes()).into_string();
394
- // elog!("token_id={:?}", t);
395
249
396
250
let pubkey = CompressedPubKey :: from_address (
397
251
"B62qnzbXmRNo9q32n4SNu2mpB8e7FYYLH8NmaX6oFCBYjjQ8SbD7uzV" ,
398
- // "B62qiTKpEPjGTSHZrtM8uXiKgn8So916pLmNJKDhKeyBQL9TDb3nvBG", // Public_key.Compressed.empty
399
252
)
400
253
. unwrap ( ) ;
401
254
@@ -405,19 +258,14 @@ impl AccountLegacy {
405
258
token_permissions : TokenPermissions :: NotOwned {
406
259
account_disabled : false ,
407
260
} ,
408
- // token_symbol: "".to_string(),
409
- // token_symbol: String::new(),
410
261
balance : Balance :: from_u64 ( 10101 ) ,
411
262
nonce : Nonce :: from_u32 ( 62772 ) ,
412
263
receipt_chain_hash : ReceiptChainHash :: default ( ) ,
413
264
delegate : Some ( pubkey) ,
414
- // delegate: None,
415
265
voting_for : VotingFor :: default ( ) ,
416
266
timing : Timing :: Untimed ,
417
267
permissions : PermissionsLegacy :: user_default ( ) ,
418
268
snap : None ,
419
- // zkapp: None,
420
- // zkapp_uri: String::new(),
421
269
}
422
270
}
423
271
0 commit comments