-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathprivate_tx_test.go
35 lines (31 loc) · 896 Bytes
/
private_tx_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package flashbots_test
import (
"math/big"
"testing"
"github.com/ethereum/go-ethereum/common"
"github.com/lmittmann/flashbots"
"github.com/lmittmann/w3"
"github.com/lmittmann/w3/rpctest"
)
func TestSendPrivateTx(t *testing.T) {
rpctest.RunTestCases(t, []rpctest.TestCase[common.Hash]{
{
Golden: "send_private_transaction",
Call: flashbots.SendPrivateTx(&flashbots.SendPrivateTxRequest{
RawTx: w3.B("0x00"),
MaxBlockNumber: big.NewInt(9_999_999),
Fast: true,
}),
WantRet: w3.H("0x45df1bc3de765927b053ec029fc9d15d6321945b23cac0614eb0b5e61f3a2f2a"),
},
})
}
func TestCancelPrivateTx(t *testing.T) {
rpctest.RunTestCases(t, []rpctest.TestCase[bool]{
{
Golden: "cancel_private_transaction",
Call: flashbots.CancelPrivateTx(w3.H("0x45df1bc3de765927b053ec029fc9d15d6321945b23cac0614eb0b5e61f3a2f2a")),
WantRet: true,
},
})
}