@@ -7,7 +7,9 @@ use acropolis_common::{
77 messages:: {
88 AddressDeltasMessage , StakeRewardDeltasMessage , TxCertificatesMessage , WithdrawalsMessage ,
99 } ,
10- queries:: accounts:: { AccountWithdrawal , DelegationUpdate , RegistrationUpdate } ,
10+ queries:: accounts:: {
11+ AccountWithdrawal , DelegationUpdate , RegistrationStatus , RegistrationUpdate ,
12+ } ,
1113 BlockInfo , InstantaneousRewardTarget , PoolId , ShelleyAddress , StakeAddress , StakeCredential ,
1214 TxCertificate , TxIdentifier ,
1315} ;
@@ -131,14 +133,14 @@ impl State {
131133 self . handle_stake_registration_change (
132134 & sc. stake_address ,
133135 & sc. tx_identifier ,
134- false ,
136+ RegistrationStatus :: Registered ,
135137 ) ;
136138 }
137139 TxCertificate :: StakeDeregistration ( sc) => {
138140 self . handle_stake_registration_change (
139141 & sc. stake_address ,
140142 & sc. tx_identifier ,
141- true ,
143+ RegistrationStatus :: Deregistered ,
142144 ) ;
143145 }
144146
@@ -147,14 +149,14 @@ impl State {
147149 self . handle_stake_registration_change (
148150 & reg. cert . stake_address ,
149151 & reg. tx_identifier ,
150- false ,
152+ RegistrationStatus :: Registered ,
151153 ) ;
152154 }
153155 TxCertificate :: Deregistration ( dreg) => {
154156 self . handle_stake_registration_change (
155157 & dreg. cert . stake_address ,
156158 & dreg. tx_identifier ,
157- true ,
159+ RegistrationStatus :: Deregistered ,
158160 ) ;
159161 }
160162
@@ -163,7 +165,7 @@ impl State {
163165 self . handle_stake_registration_change (
164166 & delegation. cert . stake_address ,
165167 & delegation. tx_identifier ,
166- false ,
168+ RegistrationStatus :: Registered ,
167169 ) ;
168170 self . handle_stake_delegation (
169171 & delegation. cert . stake_address ,
@@ -176,7 +178,7 @@ impl State {
176178 self . handle_stake_registration_change (
177179 & delegation. cert . stake_address ,
178180 & delegation. tx_identifier ,
179- false ,
181+ RegistrationStatus :: Registered ,
180182 ) ;
181183 self . handle_stake_delegation (
182184 & delegation. cert . stake_address ,
@@ -207,7 +209,7 @@ impl State {
207209 self . handle_stake_registration_change (
208210 & delegation. cert . stake_address ,
209211 & delegation. tx_identifier ,
210- false ,
212+ RegistrationStatus :: Registered ,
211213 ) ;
212214 }
213215
@@ -299,13 +301,13 @@ impl State {
299301 & mut self ,
300302 account : & StakeAddress ,
301303 tx_identifier : & TxIdentifier ,
302- deregistered : bool ,
304+ status : RegistrationStatus ,
303305 ) {
304306 let volatile = self . volatile . window . back_mut ( ) . expect ( "window should never be empty" ) ;
305307 let entry = volatile. entry ( account. clone ( ) ) . or_default ( ) ;
306308 let update = RegistrationUpdate {
307309 tx_identifier : * tx_identifier,
308- deregistered ,
310+ status ,
309311 } ;
310312 entry. registration_history . get_or_insert_with ( Vec :: new) . push ( update) ;
311313 }
0 commit comments