From 23ac8ae838bb650c9bf5ceb89a8aeb8150c1cea0 Mon Sep 17 00:00:00 2001 From: ronserruya Date: Mon, 28 Jan 2019 14:47:20 +0200 Subject: [PATCH 1/2] Add string representations for env and keypair --- kin/blockchain/environment.py | 6 ++++++ kin/blockchain/keypair.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/kin/blockchain/environment.py b/kin/blockchain/environment.py index d91c517..a1ca0c2 100644 --- a/kin/blockchain/environment.py +++ b/kin/blockchain/environment.py @@ -29,3 +29,9 @@ def __init__(self, name, horizon_endpoint_uri, network_passphrase, friendbot_url # Calculate the hash of the passphrase, can be used to calculate tx hash. self.passphrase_hash = sha256(network_passphrase.encode()).digest() + + def __str__(self): + string_representation = ': Name: {}, ' \ + 'Horizon: {}, ' \ + 'Passphrase: {}'.format(self.name, self.horizon_uri, NETWORKS[self.name.upper()]) + return string_representation diff --git a/kin/blockchain/keypair.py b/kin/blockchain/keypair.py index b186e8e..fce9cf5 100644 --- a/kin/blockchain/keypair.py +++ b/kin/blockchain/keypair.py @@ -68,3 +68,7 @@ def generate_hd_seed(base_seed, salt): # Create a new raw seed from this hash raw_seed = sha256((base_seed + salt).encode()).digest() return BaseKeypair.from_raw_seed(raw_seed).seed().decode() + + def __str__(self): + string_representation = ': Address: {}, Seed: {}'.format(self.public_address, self.secret_seed) + return string_representation From 7fcc89da9377eef9d668af23c2ac774122bd6082 Mon Sep 17 00:00:00 2001 From: ronserruya Date: Mon, 28 Jan 2019 14:54:25 +0200 Subject: [PATCH 2/2] Bump version --- kin/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kin/version.py b/kin/version.py index 55e4709..3a5935a 100644 --- a/kin/version.py +++ b/kin/version.py @@ -1 +1 @@ -__version__ = "2.3.0" +__version__ = "2.3.1"