Skip to content

Commit 84c5361

Browse files
author
Darioush Jalali
authored
fix chainID in TestWaitDeployedCornerCases (#1364)
1 parent 165ee66 commit 84c5361

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

accounts/abi/bind/util_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ func TestWaitDeployedCornerCases(t *testing.T) {
125125
// Create a transaction to an account.
126126
code := "6060604052600a8060106000396000f360606040526008565b00"
127127
tx := types.NewTransaction(0, common.HexToAddress("0x01"), big.NewInt(0), 3000000, gasPrice, common.FromHex(code))
128-
tx, _ = types.SignTx(tx, types.LatestSigner(params.TestChainConfig), testKey)
128+
tx, _ = types.SignTx(tx, types.LatestSignerForChainID(big.NewInt(1337)), testKey)
129129
ctx, cancel := context.WithCancel(context.Background())
130130
defer cancel()
131-
backend.Client().SendTransaction(ctx, tx)
131+
if err := backend.Client().SendTransaction(ctx, tx); err != nil {
132+
t.Fatalf("Failed to send transaction: %s", err)
133+
}
132134
backend.Commit(true)
133135
notContractCreation := errors.New("tx is not contract creation")
134136
if _, err := bind.WaitDeployed(ctx, backend.Client(), tx); err.Error() != notContractCreation.Error() {
@@ -137,7 +139,7 @@ func TestWaitDeployedCornerCases(t *testing.T) {
137139

138140
// Create a transaction that is not mined.
139141
tx = types.NewContractCreation(1, big.NewInt(0), 3000000, gasPrice, common.FromHex(code))
140-
tx, _ = types.SignTx(tx, types.LatestSigner(params.TestChainConfig), testKey)
142+
tx, _ = types.SignTx(tx, types.LatestSignerForChainID(big.NewInt(1337)), testKey)
141143

142144
go func() {
143145
contextCanceled := errors.New("context canceled")
@@ -146,6 +148,8 @@ func TestWaitDeployedCornerCases(t *testing.T) {
146148
}
147149
}()
148150

149-
backend.Client().SendTransaction(ctx, tx)
151+
if err := backend.Client().SendTransaction(ctx, tx); err != nil {
152+
t.Fatalf("Failed to send transaction: %s", err)
153+
}
150154
cancel()
151155
}

scripts/known_flakes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ TestResumeSyncAccountsTrieInterrupted
88
TestResyncNewRootAfterDeletes
99
TestTransactionSkipIndexing
1010
TestVMShutdownWhileSyncing
11+
TestWaitDeployedCornerCases
1112
TestWalletNotifications
1213
TestWebsocketLargeRead

0 commit comments

Comments
 (0)