@@ -146,11 +146,11 @@ func (k Keeper) ChainID() *big.Int {
146146// ----------------------------------------------------------------------------
147147
148148// EmitBlockBloomEvent emit block bloom events
149- func (k Keeper ) EmitBlockBloomEvent (ctx sdk.Context , bloom ethtypes. Bloom ) {
149+ func (k Keeper ) EmitBlockBloomEvent (ctx sdk.Context , bloom [] byte ) {
150150 ctx .EventManager ().EmitEvent (
151151 sdk .NewEvent (
152152 types .EventTypeBlockBloom ,
153- sdk .NewAttribute (types .AttributeKeyEthereumBloom , string (bloom . Bytes () )),
153+ sdk .NewAttribute (types .AttributeKeyEthereumBloom , string (bloom )),
154154 ),
155155 )
156156}
@@ -180,49 +180,6 @@ func (k Keeper) SetBlockBloomTransient(ctx sdk.Context, bloom *big.Int) {
180180 store .Set (heightBz , bloom .Bytes ())
181181}
182182
183- // ----------------------------------------------------------------------------
184- // Tx
185- // ----------------------------------------------------------------------------
186-
187- // SetTxIndexTransient set the index of processing transaction
188- func (k Keeper ) SetTxIndexTransient (ctx sdk.Context , index uint64 ) {
189- store := ctx .TransientStore (k .transientKey )
190- store .Set (types .KeyPrefixTransientTxIndex , sdk .Uint64ToBigEndian (index ))
191- }
192-
193- // GetTxIndexTransient returns EVM transaction index on the current block.
194- func (k Keeper ) GetTxIndexTransient (ctx sdk.Context ) uint64 {
195- store := ctx .TransientStore (k .transientKey )
196- bz := store .Get (types .KeyPrefixTransientTxIndex )
197- if len (bz ) == 0 {
198- return 0
199- }
200-
201- return sdk .BigEndianToUint64 (bz )
202- }
203-
204- // ----------------------------------------------------------------------------
205- // Log
206- // ----------------------------------------------------------------------------
207-
208- // GetLogSizeTransient returns EVM log index on the current block.
209- func (k Keeper ) GetLogSizeTransient (ctx sdk.Context ) uint64 {
210- store := ctx .TransientStore (k .transientKey )
211- bz := store .Get (types .KeyPrefixTransientLogSize )
212- if len (bz ) == 0 {
213- return 0
214- }
215-
216- return sdk .BigEndianToUint64 (bz )
217- }
218-
219- // SetLogSizeTransient fetches the current EVM log index from the transient store, increases its
220- // value by one and then sets the new index back to the transient store.
221- func (k Keeper ) SetLogSizeTransient (ctx sdk.Context , logSize uint64 ) {
222- store := ctx .TransientStore (k .transientKey )
223- store .Set (types .KeyPrefixTransientLogSize , sdk .Uint64ToBigEndian (logSize ))
224- }
225-
226183// ----------------------------------------------------------------------------
227184// Storage
228185// ----------------------------------------------------------------------------
@@ -349,16 +306,10 @@ func (k Keeper) getBaseFee(ctx sdk.Context, london bool) *big.Int {
349306 return baseFee
350307}
351308
352- // ResetTransientGasUsed reset gas used to prepare for execution of current cosmos tx, called in ante handler.
353- func (k Keeper ) ResetTransientGasUsed (ctx sdk.Context ) {
354- store := ctx .TransientStore (k .transientKey )
355- store .Delete (types .KeyPrefixTransientGasUsed )
356- }
357-
358309// GetTransientGasUsed returns the gas used by current cosmos tx.
359310func (k Keeper ) GetTransientGasUsed (ctx sdk.Context ) uint64 {
360311 store := ctx .TransientStore (k .transientKey )
361- bz := store .Get (types .KeyPrefixTransientGasUsed )
312+ bz := store .Get (types .TransientGasUsedKey ( ctx . TxIndex ()) )
362313 if len (bz ) == 0 {
363314 return 0
364315 }
@@ -369,7 +320,7 @@ func (k Keeper) GetTransientGasUsed(ctx sdk.Context) uint64 {
369320func (k Keeper ) SetTransientGasUsed (ctx sdk.Context , gasUsed uint64 ) {
370321 store := ctx .TransientStore (k .transientKey )
371322 bz := sdk .Uint64ToBigEndian (gasUsed )
372- store .Set (types .KeyPrefixTransientGasUsed , bz )
323+ store .Set (types .TransientGasUsedKey ( ctx . TxIndex ()) , bz )
373324}
374325
375326// AddTransientGasUsed accumulate gas used by each eth msgs included in current cosmos tx.
0 commit comments