Skip to content

Commit 49a207e

Browse files
committed
fix e2e
1 parent dcfb6db commit 49a207e

File tree

10 files changed

+24
-219
lines changed

10 files changed

+24
-219
lines changed

cmd/blockchaincmd/convert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func InitializeValidatorManager(
340340
return tracked, err
341341
}
342342
if !nativeMinterPrecompileAdminFound {
343-
nativeMinterPrecompileAdminFound, _, _, _, nativeMinterPrecompileAdminPrivateKey, err = contract.GetEVMSubnetGenesisNativeMinterManager(
343+
_, _, _, _, nativeMinterPrecompileAdminPrivateKey, err = contract.GetEVMSubnetGenesisNativeMinterManager(
344344
app,
345345
network,
346346
contract.ChainSpec{

cmd/blockchaincmd/import_public.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import (
1414
"github.com/ava-labs/avalanche-cli/pkg/contract"
1515
"github.com/ava-labs/avalanche-cli/pkg/models"
1616
"github.com/ava-labs/avalanche-cli/pkg/networkoptions"
17-
"github.com/ava-labs/avalanche-cli/sdk/evm/precompiles"
1817
"github.com/ava-labs/avalanche-cli/pkg/prompts"
1918
"github.com/ava-labs/avalanche-cli/pkg/utils"
2019
"github.com/ava-labs/avalanche-cli/pkg/ux"
2120
"github.com/ava-labs/avalanche-cli/pkg/vm"
21+
"github.com/ava-labs/avalanche-cli/sdk/evm/precompiles"
2222
validatorManagerSDK "github.com/ava-labs/avalanche-cli/sdk/validatormanager"
2323
"github.com/ava-labs/avalanche-cli/sdk/validatormanager/validatormanagertypes"
2424
"github.com/ava-labs/avalanchego/ids"

cmd/contractcmd/deploy_validator_manager.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type DeployValidatorManagerFlags struct {
3232
poa bool
3333
pos bool
3434
validatorManagerPath string
35-
rewardBasisPoints uint64
35+
rewardBasisPoints uint64
3636
}
3737

3838
var deployValidatorManagerFlags DeployValidatorManagerFlags
@@ -225,6 +225,9 @@ func CallDeployValidatorManager(cmd *cobra.Command, flags DeployValidatorManager
225225
privateKey,
226226
flags.rewardBasisPoints,
227227
)
228+
if err != nil {
229+
return err
230+
}
228231
ux.Logger.PrintToUser("Reward Calculator Address: %s", rewardCalculatorAddress.Hex())
229232
validatorManagerAddress, _, _, err = validatormanager.DeployPoSValidatorManagerV2_0_0Contract(
230233
flags.rpcEndpoint,

cmd/contractcmd/init_validator_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func initValidatorManager(_ *cobra.Command, args []string) error {
290290
return err
291291
}
292292
if !nativeMinterPrecompileAdminFound {
293-
nativeMinterPrecompileAdminFound, _, _, _, nativeMinterPrecompileAdminPrivateKey, err = contract.GetEVMSubnetGenesisNativeMinterManager(
293+
_, _, _, _, nativeMinterPrecompileAdminPrivateKey, err = contract.GetEVMSubnetGenesisNativeMinterManager(
294294
app,
295295
network,
296296
contract.ChainSpec{

cmd/interchaincmd/tokentransferrercmd/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import (
1616
"github.com/ava-labs/avalanche-cli/pkg/ictt"
1717
"github.com/ava-labs/avalanche-cli/pkg/models"
1818
"github.com/ava-labs/avalanche-cli/pkg/networkoptions"
19-
"github.com/ava-labs/avalanche-cli/sdk/evm/precompiles"
2019
"github.com/ava-labs/avalanche-cli/pkg/prompts"
2120
"github.com/ava-labs/avalanche-cli/pkg/utils"
2221
"github.com/ava-labs/avalanche-cli/pkg/ux"
22+
"github.com/ava-labs/avalanche-cli/sdk/evm/precompiles"
2323
sdkutils "github.com/ava-labs/avalanche-cli/sdk/utils"
2424
"github.com/ava-labs/avalanchego/utils/logging"
2525
"github.com/ethereum/go-ethereum/common"

cmd/validatorcmd/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"github.com/ava-labs/avalanche-cli/sdk/validatormanager"
1515
"github.com/ava-labs/avalanchego/utils/units"
1616

17-
"github.com/jedib0t/go-pretty/v6/table"
1817
"github.com/ethereum/go-ethereum/common"
18+
"github.com/jedib0t/go-pretty/v6/table"
1919
"github.com/spf13/cobra"
2020
)
2121

pkg/validatormanager/removal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ func InitializeValidatorRemoval(
5858
if currentAddress != validatorInfo.Owner {
5959
return nil, nil, fmt.Errorf("removal operation is started by address %s, but should be started by validator owner %s", currentAddress, validatorInfo.Owner)
6060
}
61-
if uptimeSec < validatorInfo.MinStakeDuration + 60 {
62-
return nil, nil, fmt.Errorf("removal operation is started with uptime sec %d, which is less than min stake duration (+60 sec) of %d", uptimeSec, validatorInfo.MinStakeDuration + 60)
61+
if uptimeSec < validatorInfo.MinStakeDuration+60 {
62+
return nil, nil, fmt.Errorf("removal operation is started with uptime sec %d, which is less than min stake duration (+60 sec) of %d", uptimeSec, validatorInfo.MinStakeDuration+60)
6363
}
6464
}
6565
if force {

sdk/validatormanager/validator_manager_pos.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func PoSValidatorManagerInitialize(
4242
return nil, nil, err
4343
}
4444
if !nativeMinterPrecompileOn {
45-
return nil, nil, fmt.Errorf("Native minter precompile should be enabled for Native PoS")
45+
return nil, nil, fmt.Errorf("native minter precompile should be enabled for Native PoS")
4646
}
4747
allowedStatus, err := precompiles.ReadAllowList(
4848
rpcURL,
@@ -54,7 +54,7 @@ func PoSValidatorManagerInitialize(
5454
}
5555
if allowedStatus.Cmp(big.NewInt(0)) == 0 {
5656
if nativeMinterPrecompileAdminPrivateKey == "" {
57-
return nil, nil, fmt.Errorf("No managed native minter precompile admin was found, and need to be used to enable Native PoS")
57+
return nil, nil, fmt.Errorf("no managed native minter precompile admin was found, and need to be used to enable Native PoS")
5858
}
5959
if err := precompiles.SetEnabled(
6060
rpcURL,
@@ -165,15 +165,15 @@ func PoSWeightToValue(
165165
}
166166

167167
type GetSettingsReturn struct {
168-
ValidatorManager common.Address
169-
MinimumStakeAmount *big.Int
170-
MaximumStakeAmount *big.Int
171-
MinimumStakeDuration uint64
168+
ValidatorManager common.Address
169+
MinimumStakeAmount *big.Int
170+
MaximumStakeAmount *big.Int
171+
MinimumStakeDuration uint64
172172
MinimumDelegationFeeBips uint16
173-
MaximumStakeMultiplier uint8
174-
WeightToValueFactor *big.Int
175-
RewardCalculator common.Address
176-
UptimeBlockchainID [32]byte
173+
MaximumStakeMultiplier uint8
174+
WeightToValueFactor *big.Int
175+
RewardCalculator common.Address
176+
UptimeBlockchainID [32]byte
177177
}
178178

179179
func GetSettings(
@@ -233,10 +233,10 @@ func GetSettings(
233233
}
234234

235235
type GetStakingValidatorReturn struct {
236-
Owner common.Address
236+
Owner common.Address
237237
DelegationFeeBips uint16
238-
MinStakeDuration uint64
239-
UptimeSeconds uint64
238+
MinStakeDuration uint64
239+
UptimeSeconds uint64
240240
}
241241

242242
func GetStakingValidator(

tests/e2e/testcases/subnet/sov/addRemoveValidatorPoS/suite.go

Lines changed: 0 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -177,153 +177,3 @@ var _ = ginkgo.Describe("[Etna AddRemove Validator SOV L1 Manager PoS]", func()
177177
commands.DeleteSubnetConfig(utils.BlockchainName)
178178
})
179179
})
180-
181-
var _ = ginkgo.Describe("[Etna AddRemove Validator SOV External Manager PoS]", func() {
182-
ginkgo.It("Create Etna Subnet Config", func() {
183-
_, avagoVersion = commands.CreateEtnaSubnetEvmConfig(
184-
utils.BlockchainName,
185-
ewoqEVMAddress,
186-
commands.PoS,
187-
)
188-
})
189-
190-
ginkgo.It("Can create an Etna Local Network", func() {
191-
output := commands.StartNetworkWithVersion(avagoVersion)
192-
fmt.Println(output)
193-
})
194-
195-
ginkgo.It("Can create a local node connected to Etna Local Network", func() {
196-
output, err := commands.CreateLocalEtnaNode(
197-
avagoVersion,
198-
utils.TestLocalNodeName,
199-
7,
200-
)
201-
gomega.Expect(err).Should(gomega.BeNil())
202-
fmt.Println(output)
203-
localClusterUris, err = utils.GetLocalClusterUris()
204-
gomega.Expect(err).Should(gomega.BeNil())
205-
gomega.Expect(len(localClusterUris)).Should(gomega.Equal(7))
206-
})
207-
208-
ginkgo.It("Deploy Etna Subnet", func() {
209-
output, err := commands.DeployEtnaBlockchain(
210-
utils.BlockchainName,
211-
utils.TestLocalNodeName,
212-
[]string{
213-
localClusterUris[0],
214-
localClusterUris[1],
215-
localClusterUris[2],
216-
localClusterUris[3],
217-
localClusterUris[4],
218-
},
219-
ewoqPChainAddress,
220-
true, // convertOnly
221-
true, // externalManager
222-
)
223-
gomega.Expect(err).Should(gomega.BeNil())
224-
fmt.Println(output)
225-
})
226-
227-
ginkgo.It("Can make cluster track a subnet", func() {
228-
output, err := commands.TrackLocalEtnaSubnet(utils.TestLocalNodeName, utils.BlockchainName)
229-
gomega.Expect(err).Should(gomega.BeNil())
230-
fmt.Println(output)
231-
// parse blockchainID from output
232-
re := regexp.MustCompile(`Waiting for blockchain ([A-Za-z0-9]+) to be bootstrapped`)
233-
// Find the first match
234-
match := re.FindStringSubmatch(output)
235-
gomega.Expect(match).ToNot(gomega.BeEmpty())
236-
if len(match) > 1 {
237-
// The first submatch will contain the chain ID
238-
blockchainID = match[1]
239-
}
240-
gomega.Expect(blockchainID).Should(gomega.Not(gomega.BeEmpty()))
241-
ginkgo.GinkgoWriter.Printf("Blockchain ID: %s\n", blockchainID)
242-
})
243-
244-
ginkgo.It("Can initialize a PoS Manager contract", func() {
245-
output, err := commands.InitValidatorManager(
246-
utils.BlockchainName,
247-
utils.TestLocalNodeName,
248-
"",
249-
blockchainID,
250-
)
251-
gomega.Expect(err).Should(gomega.BeNil())
252-
fmt.Println(output)
253-
})
254-
255-
ginkgo.It("Can add validator", func() {
256-
output, err := commands.AddEtnaSubnetValidatorToCluster(
257-
utils.TestLocalNodeName,
258-
utils.BlockchainName,
259-
localClusterUris[5],
260-
ewoqPChainAddress,
261-
1,
262-
false, // use existing
263-
)
264-
gomega.Expect(err).Should(gomega.BeNil())
265-
fmt.Println(output)
266-
})
267-
268-
ginkgo.It("Can add second validator", func() {
269-
output, err := commands.AddEtnaSubnetValidatorToCluster(
270-
utils.TestLocalNodeName,
271-
utils.BlockchainName,
272-
localClusterUris[6],
273-
ewoqPChainAddress,
274-
1,
275-
false, // use existing
276-
)
277-
gomega.Expect(err).Should(gomega.BeNil())
278-
fmt.Println(output)
279-
})
280-
281-
ginkgo.It("Can get status of thecluster", func() {
282-
output, err := commands.GetLocalClusterStatus(utils.TestLocalNodeName, utils.BlockchainName)
283-
gomega.Expect(err).Should(gomega.BeNil())
284-
fmt.Println(output)
285-
// make sure we can find string with "http://127.0.0.1:port" and "L1:Validating" string in the output
286-
parsedURL, err := url.Parse(localClusterUris[1])
287-
gomega.Expect(err).Should(gomega.BeNil())
288-
port := parsedURL.Port()
289-
gomega.Expect(port).Should(gomega.Not(gomega.BeEmpty()))
290-
regexp := fmt.Sprintf(`http://127\.0\.0\.1:%s.*Validating`, port)
291-
gomega.Expect(output).To(gomega.MatchRegexp(regexp), fmt.Sprintf("expect to have L1 validated by port %s", port))
292-
parsedURL, err = url.Parse(localClusterUris[2])
293-
gomega.Expect(err).Should(gomega.BeNil())
294-
port = parsedURL.Port()
295-
gomega.Expect(port).Should(gomega.Not(gomega.BeEmpty()))
296-
regexp = fmt.Sprintf(`http://127\.0\.0\.1:%s.*Validating`, port)
297-
gomega.Expect(output).To(gomega.MatchRegexp(regexp), fmt.Sprintf("expect to have L1 validated by port %s", port))
298-
})
299-
300-
ginkgo.It("Can sleep for min stake duration", func() {
301-
time.Sleep(3 * time.Minute)
302-
})
303-
304-
ginkgo.It("Can remove bootstrap validator", func() {
305-
output, err := commands.RemoveEtnaSubnetValidatorFromCluster(
306-
utils.TestLocalNodeName,
307-
utils.BlockchainName,
308-
localClusterUris[2],
309-
keyName,
310-
0,
311-
)
312-
gomega.Expect(err).Should(gomega.BeNil())
313-
fmt.Println(output)
314-
})
315-
316-
ginkgo.It("Can destroy local node", func() {
317-
output, err := commands.DestroyLocalNode(utils.TestLocalNodeName)
318-
gomega.Expect(err).Should(gomega.BeNil())
319-
fmt.Println(output)
320-
})
321-
322-
ginkgo.It("Can destroy Etna Local Network", func() {
323-
commands.CleanNetwork()
324-
})
325-
326-
ginkgo.It("Can remove Etna Subnet Config", func() {
327-
commands.DeleteSubnetConfig(utils.BlockchainName)
328-
})
329-
})

tests/e2e/testcases/subnet/sov/addValidatorLocal/suite.go

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -68,51 +68,3 @@ var _ = ginkgo.Describe("[Etna Add Validator SOV L1 Manager Local]", func() {
6868
commands.DeleteSubnetConfig(utils.BlockchainName)
6969
})
7070
})
71-
72-
var _ = ginkgo.Describe("[Etna Add Validator SOV External Manager Local]", func() {
73-
ginkgo.It("Create Etna Subnet Config", func() {
74-
_, avagoVersion = commands.CreateEtnaSubnetEvmConfig(
75-
utils.BlockchainName,
76-
ewoqEVMAddress,
77-
commands.PoS,
78-
)
79-
})
80-
ginkgo.It("Can deploy blockchain to localhost and upsize it", func() {
81-
output := commands.StartNetworkWithVersion(avagoVersion)
82-
fmt.Println(output)
83-
output, err := commands.DeployEtnaBlockchain(
84-
utils.BlockchainName,
85-
"",
86-
nil,
87-
ewoqPChainAddress,
88-
false, // convertOnly
89-
true, // externalManager
90-
)
91-
gomega.Expect(err).Should(gomega.BeNil())
92-
fmt.Println(output)
93-
output, err = commands.AddEtnaSubnetValidatorToCluster(
94-
"",
95-
utils.BlockchainName,
96-
"",
97-
ewoqPChainAddress,
98-
1,
99-
true,
100-
)
101-
gomega.Expect(err).Should(gomega.BeNil())
102-
fmt.Println(output)
103-
})
104-
105-
ginkgo.It("Can destroy local node", func() {
106-
output, err := commands.DestroyLocalNode(utils.TestLocalNodeName)
107-
gomega.Expect(err).Should(gomega.BeNil())
108-
fmt.Println(output)
109-
})
110-
111-
ginkgo.It("Can destroy Etna Local Network", func() {
112-
commands.CleanNetwork()
113-
})
114-
115-
ginkgo.It("Can remove Etna Subnet Config", func() {
116-
commands.DeleteSubnetConfig(utils.BlockchainName)
117-
})
118-
})

0 commit comments

Comments
 (0)