@@ -147,7 +147,7 @@ func readStateTotalStakingAmount(ctx context.Context, csr CandidateStateReader,
147
147
return & meta , csr .Height (), nil
148
148
}
149
149
150
- func readStateTotalStakingAmountFromIndexer (csr CandidateStateReader , _ * iotexapi.ReadStakingDataRequest_TotalStakingAmount , height uint64 ) (* iotextypes.AccountMeta , uint64 , error ) {
150
+ func readStateTotalStakingAmountFromIndexer (csr protocol. StateReader , _ * iotexapi.ReadStakingDataRequest_TotalStakingAmount , height uint64 ) (* iotextypes.AccountMeta , uint64 , error ) {
151
151
fmt .Println ("readStateTotalStakingAmountFromHeight" , height )
152
152
meta := iotextypes.AccountMeta {}
153
153
meta .Address = address .StakingBucketPoolAddr
@@ -232,11 +232,11 @@ func getTotalStakedAmount(ctx context.Context, csr CandidateStateReader) (*big.I
232
232
return csr .TotalStakedAmount (), nil
233
233
}
234
234
235
- func getTotalStakedAmountFromHeight (csr CandidateStateReader , height uint64 ) (* big.Int , error ) {
235
+ func getTotalStakedAmountFromHeight (csr protocol. StateReader , height uint64 ) (* big.Int , error ) {
236
236
hei := byteutil .Uint64ToBytesBigEndian (height )
237
237
historyKey := append (bucketPoolAddrKey , hei ... )
238
238
var total totalAmount
239
- _ , err := csr .SR (). State (& total , protocol .NamespaceOption (StakingNameSpace ), protocol .KeyOption (historyKey ))
239
+ _ , err := csr .State (& total , protocol .NamespaceOption (StakingNameSpace ), protocol .KeyOption (historyKey ))
240
240
fmt .Println ("getTotalStakedAmountFromHeight" , height , hex .EncodeToString (historyKey ), err )
241
241
return total .amount , err
242
242
}
0 commit comments