Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sukantoraymond committed May 29, 2024
1 parent 5e1a7c6 commit 05cd791
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion keychain/keychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (kc *Keychain) AddLedgerFunds(amount uint64) error {
return fmt.Errorf("keychain is not ledger enabled")
}

func (kc *Keychain) PChainFormattedStrAddresses() ([]string, error) {
func (kc *Keychain) GetPChainAddresses() ([]string, error) {
addrs := kc.Addresses().List()
if len(addrs) == 0 {
return nil, fmt.Errorf("no addresses in keychain")
Expand Down
16 changes: 13 additions & 3 deletions subnet/add_validator_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,25 @@ type ValidatorParams struct {
Duration time.Duration

Weight uint64

Network avalanche.Network
}

// AddValidator adds validator to subnet
func (c *Subnet) AddValidator(wallet wallet.Wallet, validatorInput ValidatorParams) (*multisig.Multisig, error) {
controlKeys, threshold, err := GetOwners(network, c.SubnetID, c.DeployInfo.TransferSubnetOwnershipTxID)
controlKeys, threshold, err := GetOwners(validatorInput.Network, c.SubnetID, c.DeployInfo.TransferSubnetOwnershipTxID)
if err != nil {
return nil, err
}
pChainAddr, err := wallet.Keychain.GetPChainAddresses()
if err != nil {
return err
return nil, err
}
var subnetAuthKeysStr []string
for _, subnetAuthKey := range subnetAuthKeysStr {
subnetAuthKeysStr = append(subnetAuthKeysStr, subnetAuthKey)
}
if err := checkSubnetAuthKeys(wallet.Keychain, c.DeployInfo.SubnetAuthKeys, controlKeys, threshold); err != nil {
if err := checkSubnetAuthKeys(pChainAddr, subnetAuthKeysStr, controlKeys, threshold); err != nil {
return nil, err
}
validator := &txs.SubnetValidator{
Expand Down

0 comments on commit 05cd791

Please sign in to comment.