Skip to content

Commit 8711629

Browse files
committed
increase tx wait time
1 parent de050b7 commit 8711629

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/tx/deploy-contract.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ func deployEvmContract(bytecode string, cmd *cobra.Command) {
112112
}
113113

114114
func waitForEthTx(ethClient8545 *ethclient.Client, txHash common.Hash) *ethtypes.Transaction {
115-
for try := 1; try <= 6; try++ {
115+
const avgBlockTime = 5 * time.Second
116+
startTime := time.Now()
117+
118+
for time.Since(startTime) < avgBlockTime*3+time.Second {
116119
tx, _, err := ethClient8545.TransactionByHash(context.Background(), txHash)
117120
if err == nil && tx != nil {
118121
return tx

0 commit comments

Comments
 (0)