Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Oct 19, 2023
1 parent 8a53b8d commit 911943d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions testutil/sample/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,32 @@ func PubKeySet() *common.PubKeySet {
return &pubKeySet
}

func Proof() (tx_index int64, block *ethtypes.Block, header ethtypes.Header, headerRLP []byte, proof *common.Proof, tx *ethtypes.Transaction, err error) {
tx_index = int64(9)
RPC_URL := "https://rpc.ankr.com/eth_goerli"
client, err := ethclient.Dial(RPC_URL)
func Proof() (txIndex int64, block *ethtypes.Block, header ethtypes.Header, headerRLP []byte, proof *common.Proof, tx *ethtypes.Transaction, err error) {
txIndex = int64(9)
url := "https://rpc.ankr.com/eth_goerli"
client, err := ethclient.Dial(url)
if err != nil {
return
}
bn := int64(9889649)
block, err = client.BlockByNumber(context.Background(), big.NewInt(bn))
if err != nil {
return
}
headerRLP, _ = rlp.EncodeToBytes(block.Header())
err = rlp.DecodeBytes(headerRLP, &header)
if err != nil {
return
}
tr := ethereum.NewTrie(block.Transactions())
var b []byte
ib := rlp.AppendUint64(b, uint64(tx_index))
ib := rlp.AppendUint64(b, uint64(txIndex))
p := ethereum.NewProof()
err = tr.Prove(ib, 0, p)
if err != nil {
return
}
proof = common.NewEthereumProof(p)
tx = block.Transactions()[tx_index]
tx = block.Transactions()[txIndex]
return
}

0 comments on commit 911943d

Please sign in to comment.