Skip to content

Commit

Permalink
Merge pull request #3281 from iotaledger/wasp-cli-sim
Browse files Browse the repository at this point in the history
Allow simulator use
  • Loading branch information
jorgemmsilva authored Feb 20, 2024
2 parents 2d23941 + a68faa7 commit b962cba
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/wasp-cli/cli/wallet/providers/ledger.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
package providers

import (
"os"

walletsdk "github.com/iotaledger/wasp-wallet-sdk"
"github.com/iotaledger/wasp/packages/parameters"
"github.com/iotaledger/wasp/tools/wasp-cli/cli/wallet/wallets"
"github.com/iotaledger/wasp/tools/wasp-cli/log"
)

func LoadLedgerWallet(sdk *walletsdk.IOTASDK, addressIndex uint32) wallets.Wallet {
secretManager, err := walletsdk.NewLedgerSecretManager(sdk, false)

useEmulator := false
if isEmulator, ok := os.LookupEnv("IOTA_SDK_USE_SIMULATOR"); isEmulator == "true" && ok {
useEmulator = true
}

secretManager, err := walletsdk.NewLedgerSecretManager(sdk, useEmulator)
log.Check(err)

status, err := secretManager.GetLedgerStatus()
Expand Down

0 comments on commit b962cba

Please sign in to comment.