Files
cli/pkg/keychain/wallet_wrapper.go
zeekay 8f56009cc7 fix: deep audit - remove stubs, fix imports, clean dead code
Deep audit changes:
- Replace stub signature aggregator with real SDK warp implementation
- Remove dead pkg/lpm package (SDK lpmintegration used instead)
- Fix fs imports: use local utils.FileExists, DirExists, ExpandHome
- Fix secp256k1fx imports: use node/vms/secp256k1fx
- Fix platformvm imports: use node/vms/platformvm
- Fix e2e test TODOs: uncomment BootstrapValidators assertions
- Improve localnet stub implementations with real logic
- Fix node.go fs.FileExists reference

Note: Build requires GOWORK=off due to workspace dependency issues
2026-01-10 11:17:00 -08:00

32 lines
972 B
Go

// Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package keychain
import (
"github.com/luxfi/ids"
"github.com/luxfi/keychain"
wallkeychain "github.com/luxfi/keychain"
"github.com/luxfi/math/set"
)
// CryptoToWalletWrapper wraps a crypto keychain to implement wallet keychain interface
type CryptoToWalletWrapper struct {
cryptoKC keychain.Keychain
}
// WrapCryptoKeychain wraps a crypto keychain to implement wallet keychain interface
func WrapCryptoKeychain(cryptoKC keychain.Keychain) wallkeychain.Keychain {
return &CryptoToWalletWrapper{cryptoKC: cryptoKC}
}
// Get returns the signer for the given address
func (w *CryptoToWalletWrapper) Get(addr ids.ShortID) (wallkeychain.Signer, bool) {
return w.cryptoKC.Get(addr)
}
// Addresses returns the addresses managed by this keychain as a set
func (w *CryptoToWalletWrapper) Addresses() set.Set[ids.ShortID] {
return w.cryptoKC.Addresses()
}