@@ -6,16 +6,19 @@ package c
6
6
import (
7
7
"math/big"
8
8
"strings"
9
+ "time"
9
10
10
11
"github.com/ava-labs/coreth/core/types"
11
12
"github.com/ava-labs/coreth/params"
13
+ "github.com/ava-labs/coreth/plugin/evm/upgrade/acp176"
12
14
"github.com/ava-labs/coreth/plugin/evm/upgrade/cortina"
13
15
"github.com/ethereum/go-ethereum/accounts/abi"
14
16
"github.com/ethereum/go-ethereum/common"
15
17
"github.com/onsi/ginkgo/v2"
16
18
"github.com/stretchr/testify/require"
17
19
"go.uber.org/zap"
18
20
21
+ "github.com/ava-labs/avalanchego/api/info"
19
22
"github.com/ava-labs/avalanchego/tests/fixture/e2e"
20
23
"github.com/ava-labs/avalanchego/tests/fixture/tmpnet"
21
24
)
@@ -28,8 +31,6 @@ var _ = e2e.DescribeCChain("[Dynamic Fees]", func() {
28
31
require := require .New (tc )
29
32
30
33
const (
31
- // gasLimit is the maximum amount of gas that can be used in a block.
32
- gasLimit = cortina .GasLimit // acp176.MinMaxCapacity
33
34
// maxFeePerGas is the maximum fee that transactions issued by this test
34
35
// will be willing to pay.
35
36
maxFeePerGas = 1000 * params .GWei
@@ -84,6 +85,24 @@ var _ = e2e.DescribeCChain("[Dynamic Fees]", func() {
84
85
return signedTx
85
86
}
86
87
88
+ // gasLimit is the maximum amount of gas that can be used in a block.
89
+ var gasLimit uint64
90
+ tc .By ("verifying Fortuna is activated" , func () {
91
+ infoClient := info .NewClient (nodeURI .URI )
92
+ upgrades , err := infoClient .Upgrades (tc .DefaultContext ())
93
+ require .NoError (err )
94
+
95
+ now := time .Now ()
96
+ if upgrades .IsFUpgradeActivated (now ) {
97
+ gasLimit = acp176 .MinMaxCapacity
98
+ } else {
99
+ gasLimit = cortina .GasLimit
100
+ }
101
+ })
102
+ tc .Log ().Info ("set gas limit" ,
103
+ zap .Uint64 ("gasLimit" , gasLimit ),
104
+ )
105
+
87
106
var contractAddress common.Address
88
107
tc .By ("deploying an expensive contract" , func () {
89
108
// Create transaction
0 commit comments