From fb2c279e0bf52a1f0fb644c65c1ee57f7f2484a4 Mon Sep 17 00:00:00 2001 From: koshikraj Date: Sun, 18 Mar 2018 11:25:40 +0530 Subject: [PATCH] adds reset method and dependency fix in setup --- justblockchain/justblockchain.py | 5 +++++ setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/justblockchain/justblockchain.py b/justblockchain/justblockchain.py index 7cb12c0..2110678 100644 --- a/justblockchain/justblockchain.py +++ b/justblockchain/justblockchain.py @@ -35,6 +35,11 @@ def dict(self, chain): return json.loads(json.dumps(chain, default=lambda o: o.__dict__)) + def reset(self): + """resets the blockchain blocks except genesis block""" + + self._chain = [self._chain[0]] + def get_genesis_block(self): """creates first block of the chain""" diff --git a/setup.py b/setup.py index 2a17224..b454c57 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ with open('HISTORY.rst') as history_file: history = history_file.read() -requirements = [ ] +requirements = ['pycryptodome'] setup_requirements = ['pytest-runner', ]