@@ -32,12 +32,15 @@ use crate::{
32
32
transaction_partially_applied:: {
33
33
TransactionPartiallyApplied , ZkappCommandPartiallyApplied ,
34
34
} ,
35
+ zkapp_command:: AccountUpdate ,
35
36
TransactionStatus ,
36
37
} ,
37
38
} ,
38
- sparse_ledger:: { LedgerIntf , SparseLedger } ,
39
+ sparse_ledger:: SparseLedger ,
39
40
staged_ledger:: hash:: AuxHash ,
40
41
verifier:: Verifier ,
42
+ zkapps:: intefaces:: LedgerInterface ,
43
+ Account ,
41
44
} ;
42
45
43
46
use self :: transaction_snark:: { InitStack , LedgerProof , OneOrTwo , Registers } ;
@@ -1434,7 +1437,7 @@ impl ScanState {
1434
1437
apply_first_pass_sparse_ledger : ApplyFirstSparse ,
1435
1438
) -> Result < Pass , String >
1436
1439
where
1437
- L : LedgerIntf + Clone ,
1440
+ L : LedgerInterface < W = ( ) , Bool = bool , Account = Account , AccountUpdate = AccountUpdate > ,
1438
1441
F : Fn ( Fp ) -> Result < MinaStateProtocolStateValueStableV2 , String > ,
1439
1442
ApplyFirst : Fn (
1440
1443
Slot ,
@@ -1455,7 +1458,9 @@ impl ScanState {
1455
1458
let stop_at_first_pass = stop_at_first_pass. unwrap_or ( false ) ;
1456
1459
1457
1460
#[ derive( Clone ) ]
1458
- enum PreviousIncompleteTxns < L : LedgerIntf + Clone > {
1461
+ enum PreviousIncompleteTxns <
1462
+ L : LedgerInterface < W = ( ) , Bool = bool , Account = Account , AccountUpdate = AccountUpdate > ,
1463
+ > {
1459
1464
Unapplied ( Vec < Arc < TransactionWithWitness > > ) ,
1460
1465
PartiallyApplied ( Vec < ( TransactionStatus , TransactionPartiallyApplied < L > ) > ) ,
1461
1466
}
@@ -1469,7 +1474,12 @@ impl ScanState {
1469
1474
get_protocol_state : F ,
1470
1475
) -> Result < TransactionPartiallyApplied < L > , String >
1471
1476
where
1472
- L : LedgerIntf + Clone ,
1477
+ L : LedgerInterface <
1478
+ W = ( ) ,
1479
+ Bool = bool ,
1480
+ Account = Account ,
1481
+ AccountUpdate = AccountUpdate ,
1482
+ > ,
1473
1483
F : Fn ( Fp ) -> Result < MinaStateProtocolStateValueStableV2 , String > ,
1474
1484
Apply : Fn (
1475
1485
Slot ,
@@ -1536,7 +1546,12 @@ impl ScanState {
1536
1546
apply_second_pass : ApplySecond ,
1537
1547
) -> Result < ( ) , String >
1538
1548
where
1539
- L : LedgerIntf + Clone ,
1549
+ L : LedgerInterface <
1550
+ W = ( ) ,
1551
+ Bool = bool ,
1552
+ Account = Account ,
1553
+ AccountUpdate = AccountUpdate ,
1554
+ > ,
1540
1555
ApplySecond :
1541
1556
Fn ( & mut L , TransactionPartiallyApplied < L > ) -> Result < TransactionApplied , String > ,
1542
1557
{
@@ -1568,7 +1583,12 @@ impl ScanState {
1568
1583
apply_txns_second_pass : ApplySecondPass ,
1569
1584
) -> Result < R , String >
1570
1585
where
1571
- L : LedgerIntf + Clone ,
1586
+ L : LedgerInterface <
1587
+ W = ( ) ,
1588
+ Bool = bool ,
1589
+ Account = Account ,
1590
+ AccountUpdate = AccountUpdate ,
1591
+ > ,
1572
1592
F : Fn ( Fp ) -> Result < MinaStateProtocolStateValueStableV2 , String > ,
1573
1593
ApplySecondPass : Fn ( Acc < L > ) -> Result < R , String > ,
1574
1594
ApplyFirstSparse : Fn (
@@ -1622,7 +1642,7 @@ impl ScanState {
1622
1642
block_global_slot : zkapp. global_state . block_global_slot ,
1623
1643
} ;
1624
1644
1625
- let local_state = LocalStateEnv {
1645
+ let local_state = LocalStateEnv :: < L > {
1626
1646
stack_frame : zkapp. local_state . stack_frame ,
1627
1647
call_stack : zkapp. local_state . call_stack ,
1628
1648
transaction_commitment : zkapp. local_state . transaction_commitment ,
@@ -1711,7 +1731,12 @@ impl ScanState {
1711
1731
apply_txns_second_pass : & ' a impl Fn ( Acc < L > ) -> Result < ( ) , String > ,
1712
1732
) -> Result < Pass , String >
1713
1733
where
1714
- L : LedgerIntf + Clone + ' a ,
1734
+ L : LedgerInterface <
1735
+ W = ( ) ,
1736
+ Bool = bool ,
1737
+ Account = Account ,
1738
+ AccountUpdate = AccountUpdate ,
1739
+ > ,
1715
1740
{
1716
1741
use PreviousIncompleteTxns :: { PartiallyApplied , Unapplied } ;
1717
1742
@@ -1862,7 +1887,7 @@ impl ScanState {
1862
1887
apply_first_pass_sparse_ledger : ApplyFirstSparse ,
1863
1888
) -> Result < Pass , String >
1864
1889
where
1865
- L : LedgerIntf + Clone ,
1890
+ L : LedgerInterface < W = ( ) , Bool = bool , Account = Account , AccountUpdate = AccountUpdate > ,
1866
1891
F : Fn ( Fp ) -> Result < MinaStateProtocolStateValueStableV2 , String > ,
1867
1892
ApplyFirst : Fn (
1868
1893
Slot ,
@@ -1899,7 +1924,7 @@ impl ScanState {
1899
1924
apply_first_pass_sparse_ledger : ApplyFirstSparse ,
1900
1925
) -> Result < Pass , String >
1901
1926
where
1902
- L : LedgerIntf + Clone ,
1927
+ L : LedgerInterface < W = ( ) , Bool = bool , Account = Account , AccountUpdate = AccountUpdate > ,
1903
1928
F : Fn ( Fp ) -> Result < MinaStateProtocolStateValueStableV2 , String > ,
1904
1929
ApplyFirst : Fn (
1905
1930
Slot ,
@@ -1939,7 +1964,7 @@ impl ScanState {
1939
1964
apply_first_pass_sparse_ledger : ApplyFirstSparse ,
1940
1965
) -> Result < Pass , String >
1941
1966
where
1942
- L : LedgerIntf + Clone ,
1967
+ L : LedgerInterface < W = ( ) , Bool = bool , Account = Account , AccountUpdate = AccountUpdate > ,
1943
1968
F : Fn ( Fp ) -> Result < MinaStateProtocolStateValueStableV2 , String > ,
1944
1969
ApplyFirst : Fn (
1945
1970
Slot ,
0 commit comments