55 "fmt"
66 "sync"
77
8- "github.com/golang/protobuf/proto" //nolint:staticcheck
8+ "github.com/golang/protobuf/proto" //nolint:staticcheck
99
10- rich "github.com/xuperchain/xupercore/bcs/ledger/xledger/batch"
10+ rb "github.com/xuperchain/xupercore/bcs/ledger/xledger/batch"
1111 "github.com/xuperchain/xupercore/bcs/ledger/xledger/def"
1212 "github.com/xuperchain/xupercore/bcs/ledger/xledger/ledger"
1313 "github.com/xuperchain/xupercore/bcs/ledger/xledger/state/context"
@@ -133,7 +133,7 @@ func (t *Meta) UpdateNewAccountResourceAmount(newAccountResourceAmount int64, ba
133133 t .log .Warn ("failed to marshal pb meta" )
134134 return pbErr
135135 }
136- err := rich .NewRichBatch (batch ).PutMeta (ledger .NewAccountResourceAmountKey , newAccountResourceAmountBuf )
136+ err := rb .NewRichBatch (batch ).PutMeta (ledger .NewAccountResourceAmountKey , newAccountResourceAmountBuf )
137137 if err == nil {
138138 t .log .Info ("Update newAccountResourceAmount succeed" )
139139 }
@@ -185,7 +185,7 @@ func (t *Meta) UpdateMaxBlockSize(maxBlockSize int64, batch kvdb.Batch) error {
185185 t .log .Warn ("failed to marshal pb meta" )
186186 return pbErr
187187 }
188- err := rich .NewRichBatch (batch ).PutMeta (ledger .MaxBlockSizeKey , maxBlockSizeBuf )
188+ err := rb .NewRichBatch (batch ).PutMeta (ledger .MaxBlockSizeKey , maxBlockSizeBuf )
189189 if err == nil {
190190 t .log .Info ("Update maxBlockSize succeed" )
191191 }
@@ -213,7 +213,7 @@ func (t *Meta) LoadReservedContracts() ([]*protos.InvokeRequest, error) {
213213 return nil , findErr
214214}
215215
216- //when to register to kernel method
216+ // when to register to kernel method
217217func (t * Meta ) UpdateReservedContracts (params []* protos.InvokeRequest , batch kvdb.Batch ) error {
218218 if params == nil {
219219 return fmt .Errorf ("invalid reservered contract requests" )
@@ -226,7 +226,7 @@ func (t *Meta) UpdateReservedContracts(params []*protos.InvokeRequest, batch kvd
226226 t .log .Warn ("failed to marshal pb meta" )
227227 return pbErr
228228 }
229- err := rich .NewRichBatch (batch ).PutMeta (ledger .ReservedContractsKey , paramsBuf )
229+ err := rb .NewRichBatch (batch ).PutMeta (ledger .ReservedContractsKey , paramsBuf )
230230 if err == nil {
231231 t .log .Info ("Update reservered contract succeed" )
232232 }
@@ -292,7 +292,7 @@ func (t *Meta) UpdateForbiddenContract(param *protos.InvokeRequest, batch kvdb.B
292292 t .log .Warn ("failed to marshal pb meta" )
293293 return pbErr
294294 }
295- err := rich .NewRichBatch (batch ).PutMeta (ledger .ForbiddenContractKey , paramBuf )
295+ err := rb .NewRichBatch (batch ).PutMeta (ledger .ForbiddenContractKey , paramBuf )
296296 if err == nil {
297297 t .log .Info ("Update forbidden contract succeed" )
298298 }
@@ -352,7 +352,7 @@ func (t *Meta) UpdateIrreversibleBlockHeight(nextIrreversibleBlockHeight int64,
352352 t .log .Warn ("failed to marshal pb meta" )
353353 return pbErr
354354 }
355- err := rich .NewRichBatch (batch ).PutMeta (ledger .IrreversibleBlockHeightKey , irreversibleBlockHeightBuf )
355+ err := rb .NewRichBatch (batch ).PutMeta (ledger .IrreversibleBlockHeightKey , irreversibleBlockHeightBuf )
356356 if err != nil {
357357 return err
358358 }
@@ -427,7 +427,7 @@ func (t *Meta) UpdateIrreversibleSlideWindow(nextIrreversibleSlideWindow int64,
427427 t .log .Warn ("failed to marshal pb meta" )
428428 return pbErr
429429 }
430- err := rich .NewRichBatch (batch ).PutMeta (ledger .IrreversibleSlideWindowKey , irreversibleSlideWindowBuf )
430+ err := rb .NewRichBatch (batch ).PutMeta (ledger .IrreversibleSlideWindowKey , irreversibleSlideWindowBuf )
431431 if err != nil {
432432 return err
433433 }
@@ -506,7 +506,7 @@ func (t *Meta) UpdateGasPrice(nextGasPrice *protos.GasPrice, batch kvdb.Batch) e
506506 t .log .Warn ("failed to marshal pb meta" )
507507 return pbErr
508508 }
509- err := rich .NewRichBatch (batch ).PutMeta (ledger .GasPriceKey , gasPriceBuf )
509+ err := rb .NewRichBatch (batch ).PutMeta (ledger .GasPriceKey , gasPriceBuf )
510510 if err != nil {
511511 return err
512512 }
0 commit comments