-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathwallet.py
More file actions
19 lines (17 loc) · 702 Bytes
/
Copy pathwallet.py
File metadata and controls
19 lines (17 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from server_wallet import ServerWallet
from client_wallet import ClientWallet
from plain_wallet import PlainWallet
from memory_wallet import MemoryWallet
# This is a factory method to instantiate a wallet. The wallet constructor handles the logic
# of determining whether a wallet needs to be created from scratch.
def create_wallet(wallet_type, key, logger):
if wallet_type == 'ServerWallet':
wallet = ServerWallet(key, logger)
elif wallet_type == 'ClientWallet':
wallet = ClientWallet(key)
elif wallet_type == 'MemoryWallet':
wallet = MemoryWallet(key) # Used for file encryption
else:
wallet = PlainWallet()
wallet.instance()
return wallet