From bef6e785ecb68846b8ebd12e69f7a634a16efe97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Faruk=20IRMAK?= Date: Thu, 30 Nov 2023 14:40:04 +0300 Subject: [PATCH] Make empty pending follow previous block's GasPriceSTRK --- blockchain/blockchain.go | 1 + blockchain/blockchain_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index f1709d0e2c..d7e38a3731 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -934,6 +934,7 @@ func (b *Blockchain) storeEmptyPending(txn db.Transaction, latestHeader *core.He ProtocolVersion: latestHeader.ProtocolVersion, EventsBloom: core.EventsBloom(receipts), GasPrice: latestHeader.GasPrice, + GasPriceSTRK: latestHeader.GasPriceSTRK, }, Transactions: make([]core.Transaction, 0), Receipts: receipts, diff --git a/blockchain/blockchain_test.go b/blockchain/blockchain_test.go index a94e9a3ba5..28bc085cb7 100644 --- a/blockchain/blockchain_test.go +++ b/blockchain/blockchain_test.go @@ -662,6 +662,7 @@ func TestPending(t *testing.T) { assert.Equal(t, pendingGenesis, gotPending) }) + b.GasPriceSTRK = utils.HexToFelt(t, "0xDEADBEEF") require.NoError(t, chain.Store(b, &emptyCommitments, su, nil)) t.Run("no pending block means pending state matches head state", func(t *testing.T) { @@ -670,6 +671,7 @@ func TestPending(t *testing.T) { require.Equal(t, b.Timestamp+1, pending.Block.Timestamp) require.Equal(t, b.SequencerAddress, pending.Block.SequencerAddress) require.Equal(t, b.GasPrice, pending.Block.GasPrice) + require.Equal(t, b.GasPriceSTRK, pending.Block.GasPriceSTRK) require.Equal(t, b.ProtocolVersion, pending.Block.ProtocolVersion) require.Equal(t, su.NewRoot, pending.StateUpdate.OldRoot) require.Empty(t, pending.StateUpdate.StateDiff.Nonces)