Skip to content

Commit

Permalink
Remove redundant generateHeader method
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed Mar 22, 2024
1 parent 04991d2 commit 952dc0a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions common/headers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package common_test

import (
"bytes"
"context"
"encoding/base64"
"fmt"
"math/big"
Expand All @@ -16,24 +15,14 @@ import (
"github.com/btcsuite/btcd/rpcclient"
"github.com/btcsuite/btcd/wire"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/stretchr/testify/require"
"github.com/zeta-chain/zetacore/common"
"github.com/zeta-chain/zetacore/common/testdata"
)

const numHeadersToTest = 100

func generateHeader() {
rpcclient, _ := ethclient.Dial("https://eth.llamarpc.com")
header, _ := rpcclient.HeaderByNumber(context.Background(), big.NewInt(18495266))
file, _ := os.Create("testdata/eth_header_18495266.json")
b, _ := header.MarshalJSON()
file.Write(b)
}

func TestTrueEthereumHeader(t *testing.T) {
generateHeader()
var header ethtypes.Header
// read file into a byte slice
file, err := os.Open("./testdata/eth_header_18495266.json")
Expand Down Expand Up @@ -61,7 +50,6 @@ func TestTrueEthereumHeader(t *testing.T) {
}

func TestFalseEthereumHeader(t *testing.T) {
generateHeader()
var header ethtypes.Header
// read file into a byte slice
file, err := os.Open("./testdata/eth_header_18495266.json")
Expand Down

0 comments on commit 952dc0a

Please sign in to comment.