Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
cherry-yl-sh committed May 7, 2024
1 parent ea275c3 commit a39232d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions common/ethereum_contract/ethereum_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ func TestPaymasterV07(t *testing.T) {
contractAddress := common.HexToAddress("0x3Da96267B98a33267249734FD8FFeC75093D3085")
client, err := ethclient.Dial(network)
if err != nil {
t.Errorf("Error: %v", err)
t.Fatalf("Error: %v", err)
return
}
id, er := client.ChainID(context.Background())
if er != nil {
t.Errorf("Error: %v", er)
t.Fatalf("Error: %v", er)
return
}
t.Log(id)
contractInstance, err := paymaster_verifying_erc20_v07.NewContract(contractAddress, client)
if err != nil {
t.Errorf("Error: %v", err)
t.Fatalf("Error: %v", err)
return
}
//writeInstance, err := paymaster_verifying_erc20_v07.NewContractTransactor(contractAddress, client)
//if err != nil {
// t.Errorf("Error: %v", err)
// t.Fatalf("Error: %v", err)
// return
//}
tests := []struct {
Expand Down Expand Up @@ -67,12 +67,12 @@ func parsePaymasterData(t *testing.T, contractInstance *paymaster_verifying_erc2
paymasterData := "3da96267b98a33267249734fd8ffec75093d308500000000004c4b40000000000000000000000000001e84800000000000000000000000000000000000000000000000000000000000000000000000006c7bacd00000000000000000000000000000000000000000000000000000000065ed355000000000000000000000000086af7fa0d8b0b7f757ed6cdd0e2aadb33b03be580000000000000000000000000000000000000000000000000000000000000000293df680d08a6d4da0bb7c0ba6d65af835b31f727e83b30e470a697c886597a50e96c2db45aa54b5f83c977745af6b948e86fbabf0fa96f5670e382b7586ac121b"
paymasterDataByte, er := hex.DecodeString(paymasterData)
if er != nil {
t.Errorf("Error: %v", er)
t.Fatalf("Error: %v", er)
return
}
res, err := contractInstance.ParsePaymasterAndData(&bind.CallOpts{}, paymasterDataByte)
if err != nil {
t.Errorf("Error: %v", err)
t.Fatalf("Error: %v", err)
return
}
resJson, _ := json.Marshal(res)
Expand All @@ -83,14 +83,14 @@ func parsePaymasterData(t *testing.T, contractInstance *paymaster_verifying_erc2
func testV07Deposit(t *testing.T, contractInstance *paymaster_verifying_erc20_v07.Contract) {
deopsit, err := contractInstance.GetDeposit(&bind.CallOpts{})
if err != nil {
t.Errorf("Error: %v", err)
t.Fatalf("Error: %v", err)
return
}
t.Log(deopsit)

verifier, err := contractInstance.Verifier(&bind.CallOpts{})
if err != nil {
t.Errorf("Error: %v", err)
t.Fatalf("Error: %v", err)
return
}
t.Log(verifier)
Expand Down
2 changes: 1 addition & 1 deletion common/network/ethereum_adaptable_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func testEthereumExecutorClientConnect(t *testing.T, chain global_const.Network)
t.Error("chainId is nil")
}
if chainId.String() != executor.ChainId.String() {
t.Errorf(" %s chainId not equal %s", chainId.String(), executor.ChainId.String())
t.Fatalf(" %s chainId not equal %s", chainId.String(), executor.ChainId.String())
}
t.Logf("network %s chainId: %s", chain, chainId.String())
}
4 changes: 2 additions & 2 deletions common/network/starknet/starknet_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ func TestDemo(t *testing.T) {
//only read
starkProvider, err := rpc.NewProvider("https://starknet-sepolia.public.blastapi.io/rpc/v0_7")
if err != nil {
t.Errorf("Error: %v", err)
t.Fatalf("Error: %v", err)
return
}
chainId, chainIdError := starkProvider.ChainID(context.Background())
if chainIdError != nil {
t.Errorf("Error: %v", chainIdError)
t.Fatalf("Error: %v", chainIdError)
return
}
//starkProvider.SimulateTransactions()
Expand Down
4 changes: 2 additions & 2 deletions common/utils/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ func TestConvertStringToSet(t *testing.T) {
//
// sign, err := GetSign(messageByte, privateKey)
// if err != nil {
// t.Errorf("has Error %s", err)
// t.Fatalf("has Error %s", err)
// return
// }
// t.Logf("sign: %x\n", sign)
//
// sigPublicKey, err := crypto.Ecrecover(hash.Bytes(), sign)
// if err != nil {
// t.Errorf("has Error %s", err)
// t.Fatalf("has Error %s", err)
// return
// }
// matches := bytes.Equal(sigPublicKey, publicKeyBytes)
Expand Down
4 changes: 2 additions & 2 deletions gas_executor/gas_computor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func TestComputeGas(t *testing.T) {
func(*testing.T) {
strategy := config.GetBasicStrategyConfig(global_const.StrategyCodeScrollSepoliaV06Erc20)
strategy.Erc20TokenType = global_const.TokenTypeUSDT
testComputeGas(t, op, strategy)
testComputeGas(t, opFor1559NotSupport, strategy)
},
},
{
Expand Down Expand Up @@ -236,7 +236,7 @@ func testComputeGas(t *testing.T, input *user_op.UserOpInput, strategy *model.St
paymasterDataInput := paymaster_data.NewPaymasterDataInput(strategy)
res, _, err := ComputeGas(input, strategy, paymasterDataInput)
if err != nil {
t.Error(err)
t.Fatalf("err: %v", err)
return
}
if res == nil {
Expand Down

0 comments on commit a39232d

Please sign in to comment.