From 9ab791d43de52067eaedbb88ef967885ec94d214 Mon Sep 17 00:00:00 2001 From: AnkushinDaniil Date: Wed, 22 Jan 2025 12:44:18 +0300 Subject: [PATCH] Remove L2GasPriceETH and L2GasPriceSTRK methods --- starknet/block.go | 16 ---------------- starknet/block_test.go | 30 ------------------------------ 2 files changed, 46 deletions(-) delete mode 100644 starknet/block_test.go diff --git a/starknet/block.go b/starknet/block.go index 39ad3ad55b..ceabe842af 100644 --- a/starknet/block.go +++ b/starknet/block.go @@ -53,22 +53,6 @@ func (b *Block) L1GasPriceSTRK() *felt.Felt { return b.GasPriceFRI } -// TODO: Fix when we have l2 gas price -func (b *Block) L2GasPriceETH() *felt.Felt { - if b.L2GasPrice != nil { - return b.L2GasPrice.PriceInWei - } - return &felt.Zero -} - -// TODO: Fix when we have l2 gas price -func (b *Block) L2GasPriceSTRK() *felt.Felt { - if b.L2GasPrice != nil { - return b.L2GasPrice.PriceInFri - } - return &felt.Zero -} - type L1DAMode uint const ( diff --git a/starknet/block_test.go b/starknet/block_test.go deleted file mode 100644 index 73dd158bab..0000000000 --- a/starknet/block_test.go +++ /dev/null @@ -1,30 +0,0 @@ -package starknet_test - -import ( - "testing" - - "github.com/NethermindEth/juno/core/felt" - "github.com/NethermindEth/juno/starknet" - "github.com/stretchr/testify/assert" -) - -func TestL2GasPrice(t *testing.T) { - t.Run("L2GasPrice is not set", func(t *testing.T) { - block := starknet.Block{} - assert.Equal(t, &felt.Zero, block.L2GasPriceETH()) - assert.Equal(t, &felt.Zero, block.L2GasPriceSTRK()) - }) - - t.Run("L2GasPrice is set", func(t *testing.T) { - gasPriceWei := new(felt.Felt).SetUint64(100) - gasPriceFri := new(felt.Felt).SetUint64(50) - block := starknet.Block{ - L2GasPrice: &starknet.GasPrice{ - PriceInWei: gasPriceWei, - PriceInFri: gasPriceFri, - }, - } - assert.Equal(t, gasPriceWei, block.L2GasPriceETH()) - assert.Equal(t, gasPriceFri, block.L2GasPriceSTRK()) - }) -}