Skip to content

Commit

Permalink
Merge branch 'convertSubnetTx3' into subnet-create-nonsov
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 241b7f8 + 136fd35 commit 539bc60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 51 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) {
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
19 changes: 1 addition & 18 deletions cmd/blockchaincmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,24 +606,7 @@ func deployBlockchain(cmd *cobra.Command, args []string) error {
}
}

if !sidecar.NotSOV {
// type ConvertSubnetTx struct {
// // Metadata, inputs and outputs
// BaseTx
// // ID of the Subnet to transform
// // Restrictions:
// // - Must not be the Primary Network ID
// Subnet ids.ID `json:"subnetID"`
// // BlockchainID where the Subnet manager lives
// ChainID ids.ID `json:"chainID"`
// // Address of the Subnet manager
// Address []byte `json:"address"`
// // Initial pay-as-you-go validators for the Subnet
// Validators []SubnetValidator `json:"validators"`
// // Authorizes this conversion
// SubnetAuth verify.Verifiable `json:"subnetAuthorization"`
// }

if sidecar.Sovereign {

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

View workflow job for this annotation

GitHub Actions / Lint

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / Lint

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / Lint

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / Golang Unit Tests v1.21.7 (ubuntu-20.04)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / Golang Unit Tests v1.21.7 (macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Key\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Error handling\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Node devnet\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Node create\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Subnet\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Subnet Compatibility\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Network\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[APM\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Package Management\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Root\], ubuntu-latest)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Root\], macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Network\], macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[APM\], macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Key\], macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Error handling\], macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Subnet\], macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Subnet Compatibility\], macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)

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

View workflow job for this annotation

GitHub Actions / e2e tests (\[Package Management\], macos-13)

sidecar.Sovereign undefined (type models.Sidecar has no field or method Sovereign)
//avaGoBootstrapValidators, err := convertToAvalancheGoSubnetValidator(bootstrapValidators)
//if err != nil {
// return err
Expand Down

0 comments on commit 539bc60

Please sign in to comment.