@@ -429,26 +429,13 @@ impl Sequencer {
429
429
430
430
Ok ( Proof :: Update ( proof) )
431
431
}
432
- Operation :: CreateAccount ( CreateAccountArgs {
433
- id,
434
- value,
435
- signature,
436
- service_id,
437
- challenge,
438
- } ) => {
439
- // validation of account source
440
- match challenge {
441
- // TODO: use Signature, not String
442
- AccountSource :: SignedBySequencer { signature } => {
443
- let sig = Signature :: from_str ( signature)
444
- . context ( "Failed to parse sequencer's signature" ) ?;
445
- self . key
446
- . verify ( format ! ( "{}{:?}" , id, value) . as_bytes ( ) , & sig)
447
- . map_err ( GeneralError :: InvalidSignature )
448
- }
449
- } ?;
432
+ Operation :: CreateAccount ( args) => {
433
+ let id = args. id . clone ( ) ;
434
+ match & args. challenge {
435
+ ServiceChallengeInput :: Signed ( _) => debug ! ( "Signature verification for service challenge gate not yet implemented. Skipping verification." )
436
+ } ;
450
437
451
- let hashchain: Result < Hashchain > = self . db . get_hashchain ( id) ;
438
+ let hashchain: Result < Hashchain > = self . db . get_hashchain ( id. as_str ( ) ) ;
452
439
if hashchain. is_ok ( ) {
453
440
return Err ( DatabaseError :: NotFoundError ( format ! (
454
441
"empty slot for ID {}" ,
@@ -457,13 +444,13 @@ impl Sequencer {
457
444
. into ( ) ) ;
458
445
}
459
446
460
- debug ! ( "creating new hashchain for user id {}" , id. clone( ) ) ;
461
- let mut chain = Hashchain :: new ( id. clone ( ) ) ;
462
- // TODO: Challenge is a placeholder rn
447
+ debug ! ( "creating new hashchain for user id {}" , args. id) ;
448
+ let mut chain = Hashchain :: new ( id) ;
463
449
chain. create_account (
464
- * value,
465
- * signature,
466
- * service_id,
450
+ args. value . clone ( ) ,
451
+ args. signature . clone ( ) ,
452
+ args. service_id . clone ( ) ,
453
+ // TODO: Challenge is a placeholder rn
467
454
ServiceChallengeInput :: Signed ( Vec :: new ( ) ) ,
468
455
) ?;
469
456
@@ -472,7 +459,7 @@ impl Sequencer {
472
459
operation
473
460
) ) ?;
474
461
475
- let hashed_id = hash ( id. as_bytes ( ) ) ;
462
+ let hashed_id = hash ( args . id . as_bytes ( ) ) ;
476
463
477
464
Ok ( Proof :: Insert (
478
465
tree. insert ( KeyHash :: with :: < Hasher > ( hashed_id) , chain) ?,
0 commit comments