Skip to content

Commit 394ce8e

Browse files
authored
enable change owner for sov (#2621)
1 parent 3b253af commit 394ce8e

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

cmd/blockchaincmd/change_owner.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package blockchaincmd
44

55
import (
6-
"errors"
76
"fmt"
87

98
"github.com/ava-labs/avalanche-cli/pkg/cobrautils"
@@ -15,6 +14,7 @@ import (
1514
"github.com/ava-labs/avalanche-cli/pkg/utils"
1615
"github.com/ava-labs/avalanche-cli/pkg/ux"
1716
"github.com/ava-labs/avalanchego/ids"
17+
1818
"github.com/spf13/cobra"
1919
)
2020

@@ -90,22 +90,15 @@ func changeOwner(_ *cobra.Command, args []string) error {
9090
return err
9191
}
9292

93-
if sc.Sovereign {
94-
return errors.New("avalanche blockchain changeOwner is not applicable to sovereign blockchains")
95-
}
96-
9793
subnetID := sc.Networks[network.Name()].SubnetID
9894
if subnetID == ids.Empty {
9995
return errNoSubnetID
10096
}
10197

102-
isPermissioned, currentControlKeys, currentThreshold, err := txutils.GetOwners(network, subnetID)
98+
_, currentControlKeys, currentThreshold, err := txutils.GetOwners(network, subnetID)
10399
if err != nil {
104100
return err
105101
}
106-
if !isPermissioned {
107-
return ErrNotPermissionedSubnet
108-
}
109102

110103
// add control keys to the keychain whenever possible
111104
if err := kc.AddAddresses(currentControlKeys); err != nil {

cmd/blockchaincmd/describe.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,11 @@ func PrintSubnetInfo(blockchainName string, onlyLocalnetInfo bool) error {
149149
}
150150
if data.SubnetID != ids.Empty {
151151
t.AppendRow(table.Row{net, "SubnetID", data.SubnetID.String()})
152-
isPermissioned, owners, threshold, err := txutils.GetOwners(network, data.SubnetID)
152+
_, owners, threshold, err := txutils.GetOwners(network, data.SubnetID)
153153
if err != nil {
154154
return err
155155
}
156-
if isPermissioned {
157-
t.AppendRow(table.Row{net, fmt.Sprintf("Owners (Threhold=%d)", threshold), strings.Join(owners, "\n")})
158-
}
156+
t.AppendRow(table.Row{net, fmt.Sprintf("Owners (Threhold=%d)", threshold), strings.Join(owners, "\n")})
159157
}
160158
if data.BlockchainID != ids.Empty {
161159
hexEncoding := "0x" + hex.EncodeToString(data.BlockchainID[:])

0 commit comments

Comments
 (0)