Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit e866365

Browse files
custom wallet function added (#230)
Signed-off-by: anonsachin <[email protected]> Co-authored-by: Andrew Coleman <[email protected]>
1 parent cbdc79f commit e866365

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

pkg/gateway/filesystemwallet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func NewFileSystemWallet(path string) (*Wallet, error) {
3737
}
3838

3939
store := &fileSystemWalletStore{cleanPath}
40-
return &Wallet{store}, nil
40+
return NewWalletWithStore(store), nil
4141

4242
}
4343

pkg/gateway/wallet.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ type wallet interface {
2525
List() ([]string, error)
2626
}
2727

28+
// NewWalletWithStore is used for creating wallets with custom walletstores as backends.
29+
// Parameters:
30+
// store is the WalletStore you want to use as the backend for the wallet.
31+
//
32+
// Returns:
33+
// The Wallet object.
34+
func NewWalletWithStore(store WalletStore) *Wallet {
35+
return &Wallet{store: store}
36+
}
37+
2838
// A Wallet stores identity information used to connect to a Hyperledger Fabric network.
2939
// Instances are created using factory methods on the implementing objects.
3040
type Wallet struct {

0 commit comments

Comments
 (0)