Skip to content

Commit

Permalink
Merge branch 'subnet-create-nonsov' into convertSubnetAvaGo
Browse files Browse the repository at this point in the history
Signed-off-by: sukantoraymond <[email protected]>
  • Loading branch information
sukantoraymond authored Oct 8, 2024
2 parents 9c3323f + 6cfd55d commit d62c8c6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
24 changes: 1 addition & 23 deletions cmd/blockchaincmd/add_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,28 +231,6 @@ func CallAddValidator(
ux.Logger.PrintToUser("Change Address: %s", changeAddr)
ux.Logger.PrintToUser("Inputs complete, issuing transaction to add the provided validator information...")

//type RegisterSubnetValidatorTx struct {
// // Metadata, inputs and outputs
// BaseTx
// // Balance <= sum($AVAX inputs) - sum($AVAX outputs) - TxFee.
// Balance uint64 `json:"balance"`
// // [Signer] is the BLS key for this validator.
// // Note: We do not enforce that the BLS key is unique across all validators.
// // This means that validators can share a key if they so choose.
// // However, a NodeID does uniquely map to a BLS key
// Signer signer.Signer `json:"signer"`
// // Leftover $AVAX from the Subnet Validator's Balance will be issued to
// // this owner after it is removed from the validator set.
// ChangeOwner fx.Owner `json:"changeOwner"`
// // AddressedCall with Payload:
// // - SubnetID
// // - NodeID (must be Ed25519 NodeID)
// // - Weight
// // - BLS public key
// // - Expiry
// Message warp.Message `json:"message"`
//}

blsInfo, err := getBLSInfo(publicKey, pop)
if err != nil {
return fmt.Errorf("failure parsing BLS info: %w", err)
Expand Down Expand Up @@ -283,7 +261,7 @@ func CallAddValidator(
return nil
}

func generateWarpMessageAddValidator(SubnetID ids.ID, NodeID ids.NodeID, weight uint64, blsPublicKey string, expiry uint64) (warpPlatformVM.Message, error) {
func generateWarpMessageAddValidator(subnetID ids.ID, NodeID ids.NodeID, weight uint64, blsPublicKey string, expiry uint64) (warpPlatformVM.Message, error) {

Check failure on line 264 in cmd/blockchaincmd/add_validator.go

View workflow job for this annotation

GitHub Actions / Lint

captLocal: `NodeID' should not be capitalized (gocritic)
return warpPlatformVM.Message{}, nil
}

Expand Down
12 changes: 2 additions & 10 deletions cmd/blockchaincmd/change_weight.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ package blockchaincmd
import (
"errors"
"fmt"
"os"

"github.com/ava-labs/avalanche-cli/pkg/cobrautils"
"github.com/ava-labs/avalanche-cli/pkg/constants"
"github.com/ava-labs/avalanche-cli/pkg/keychain"
Expand All @@ -15,7 +17,6 @@ import (
"github.com/ava-labs/avalanche-cli/pkg/ux"
"github.com/ava-labs/avalanchego/ids"
"github.com/spf13/cobra"
"os"
)

// avalanche blockchain addValidator
Expand Down Expand Up @@ -47,9 +48,6 @@ func setWeight(_ *cobra.Command, args []string) error {
return err
}

//TODO: add check for non SOV subnet
// return err if non SOV

network, err := networkoptions.GetNetworkFromCmdLineFlags(
app,
"",
Expand Down Expand Up @@ -177,12 +175,6 @@ func setWeight(_ *cobra.Command, args []string) error {
return CallAddValidator(deployer, network, kc, useLedger, blockchainName, nodeID.String())
}

// TODO: implement checkIfSubnetIsSOV
// checkIfSubnetIsSOV returns true if Subnet is SOV from P Chain
func checkIfSubnetIsSOV() (bool, error) {
return false, nil
}

// getValidatorBalanceFromPChain gets remaining balance of validator from p chain
func getValidatorBalanceFromPChain() (uint64, error) {
return 0, nil
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/commands/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func CreateSubnetEvmConfigWithVersionNonSOV(subnetName string, genesisPath strin
"create",
"--genesis",
genesisPath,
"--not-sov",
"--sovereign=false",
"--evm",
subnetName,
"--" + constants.SkipUpdateFlag,
Expand Down Expand Up @@ -178,7 +178,7 @@ func CreateCustomVMConfigNonSOV(subnetName string, genesisPath string, vmPath st
"create",
"--genesis",
genesisPath,
"--not-sov",
"--sovereign=false",
"--custom",
subnetName,
"--custom-vm-path",
Expand Down

0 comments on commit d62c8c6

Please sign in to comment.