Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemadero committed May 23, 2024
1 parent 594e35a commit 0b09c3a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions subnet/subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"avalanche-tooling-sdk-go/avalanche"
"context"
"fmt"
"testing"

"github.com/ava-labs/avalanchego/vms/secp256k1fx"
"github.com/ava-labs/avalanchego/wallet/subnet/primary"
"testing"
)

func TestSubnetDeploy(t *testing.T) {

Check warning on line 16 in subnet/subnet_test.go

View workflow job for this annotation

GitHub Actions / Lint

unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
Expand All @@ -27,7 +28,7 @@ func TestSubnetDeploy(t *testing.T) {
}
newSubnet := New(baseApp, &subnetParams)
ctx := context.Background()
wallet, _ := primary.MakeWallet(
wallet, _ := NewWallet(
ctx,
&primary.WalletConfig{
URI: "",
Expand Down
13 changes: 13 additions & 0 deletions subnet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package subnet

import (
"context"

"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/utils/crypto/keychain"
"github.com/ava-labs/avalanchego/utils/set"
Expand All @@ -18,6 +20,17 @@ type Wallet struct {
options []common.Option
}

func NewWallet(ctx context.Context, config *primary.WalletConfig) (Wallet, error) {
wallet, err := primary.MakeWallet(
ctx,
config,
)
return Wallet{
Wallet: wallet,
keychain: config.AVAXKeychain,
}, err
}

// secure that a fee paying address (wallet's keychain) will receive the change,
// and not a randomly selected auth key that may not be paying fees
func (w *Wallet) SecureWalletIsChangeOwner() {
Expand Down

0 comments on commit 0b09c3a

Please sign in to comment.