Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sukantoraymond committed Sep 23, 2024
1 parent d40b767 commit 361bf60
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
18 changes: 1 addition & 17 deletions cmd/blockchaincmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ var (
subnetOnly bool
icmSpec subnet.ICMSpec
generateNodeID bool
validatorManagerOwner string
bootstrapValidatorsJSONFilePath string

errMutuallyExlusiveControlKeys = errors.New("--control-keys and --same-control-key are mutually exclusive")
Expand Down Expand Up @@ -113,7 +112,6 @@ so you can take your locally tested Subnet and deploy it on Fuji or Mainnet.`,
cmd.Flags().StringVar(&icmSpec.MessengerDeployerAddressPath, "teleporter-messenger-deployer-address-path", "", "path to an interchain messenger deployer address file")
cmd.Flags().StringVar(&icmSpec.MessengerDeployerTxPath, "teleporter-messenger-deployer-tx-path", "", "path to an interchain messenger deployer tx file")
cmd.Flags().StringVar(&icmSpec.RegistryBydecodePath, "teleporter-registry-bytecode-path", "", "path to an interchain messenger registry bytecode file")
cmd.Flags().StringVar(&validatorManagerOwner, "validator-manager-owner", "", "EVM address that controls Validator Manager Controller (for Proof of Authority only)")
cmd.Flags().StringVar(&bootstrapValidatorsJSONFilePath, "bootstrap-filepath", "", "JSON file path that provides details about bootstrap validators, leave Node-ID and BLS values empty if using --generate-node-id=true")
cmd.Flags().BoolVar(&generateNodeID, "generate-node-id", false, "whether to create new node id for bootstrap validators (Node-ID and BLS values in bootstrap JSON file will be overridden if --bootstrap-filepath flag is used)")
return cmd
Expand Down Expand Up @@ -309,10 +307,6 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
return errors.New("unable to deploy subnets imported from a repo")
}

if sidecar.ValidatorManagement != models.ProofOfAuthority && validatorManagerOwner != "" {
return errors.New("--validator-manager-controller flag cannot be used when blockchain validator management type is not Proof of Authority")
}

if outputTxPath != "" {
if _, err := os.Stat(outputTxPath); err == nil {
return fmt.Errorf("outputTxPath %q already exists", outputTxPath)
Expand Down Expand Up @@ -422,7 +416,6 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
deployInfo.ICMMessengerAddress,
deployInfo.ICMRegistryAddress,
bootstrapValidators,
validatorManagerOwner,
); err != nil {
return err
}
Expand Down Expand Up @@ -525,15 +518,6 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
}
ux.Logger.PrintToUser("Your subnet auth keys for chain creation: %s", subnetAuthKeys)

if validatorManagerOwner == "" {
validatorManagerOwnerEVMAddress, err := getValidatorContractOwnerAddr()
if err != nil {
return err
}
validatorManagerOwner = validatorManagerOwnerEVMAddress.String()
}
ux.Logger.PrintToUser("Validator Manager Contract controller address %s", validatorManagerOwner)

// deploy to public network
deployer := subnet.NewPublicDeployer(app, kc, network)

Expand Down Expand Up @@ -598,7 +582,7 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {

// update sidecar
// TODO: need to do something for backwards compatibility?
return app.UpdateSidecarNetworks(&sidecar, network, subnetID, blockchainID, "", "", bootstrapValidators, validatorManagerOwner)
return app.UpdateSidecarNetworks(&sidecar, network, subnetID, blockchainID, "", "", bootstrapValidators)
}

func getValidatorContractOwnerAddr() (common.Address, error) {

Check failure on line 588 in cmd/blockchaincmd/deploy.go

View workflow job for this annotation

GitHub Actions / Lint

func `getValidatorContractOwnerAddr` is unused (unused)
Expand Down
2 changes: 1 addition & 1 deletion cmd/transactioncmd/transaction_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func commitTx(_ *cobra.Command, args []string) error {
if err := blockchaincmd.PrintDeployResults(subnetName, subnetID, txID); err != nil {
return err
}
return app.UpdateSidecarNetworks(&sc, network, subnetID, txID, "", "", sc.Networks[network.Name()].BootstrapValidators, sc.Networks[network.Name()].PoAValidatorManagerOwner)
return app.UpdateSidecarNetworks(&sc, network, subnetID, txID, "", "", sc.Networks[network.Name()].BootstrapValidators)
}

return nil
Expand Down
2 changes: 0 additions & 2 deletions pkg/application/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ func (app *Avalanche) UpdateSidecarNetworks(
teleporterMessengerAddress string,
teleporterRegistryAddress string,
bootstrapValidators []models.SubnetValidator,
validatorManagerController string,
) error {
if sc.Networks == nil {
sc.Networks = make(map[string]models.NetworkData)
Expand All @@ -545,7 +544,6 @@ func (app *Avalanche) UpdateSidecarNetworks(
RPCVersion: sc.RPCVersion,
TeleporterMessengerAddress: teleporterMessengerAddress,
TeleporterRegistryAddress: teleporterRegistryAddress,
PoAValidatorManagerOwner: validatorManagerController,
BootstrapValidators: bootstrapValidators,
}
if err := app.UpdateSidecar(sc); err != nil {
Expand Down
1 change: 0 additions & 1 deletion pkg/models/sidecar.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type NetworkData struct {
RPCVersion int
TeleporterMessengerAddress string
TeleporterRegistryAddress string
PoAValidatorManagerOwner string
RPCEndpoints []string
WSEndpoints []string
BootstrapValidators []SubnetValidator
Expand Down

0 comments on commit 361bf60

Please sign in to comment.