commit 7336c46f0e692cbe1270077e2d686794d293777c parent 6929b16d8c38d90a57000538f836d8d8731de04d Author: nolash <dev@holbrook.no> Date: Sat, 12 Dec 2020 12:42:06 +0100 Add storage abi accessor Diffstat:
M | python/erc20_single_shot_faucet/faucet.py | | | 9 | ++++++++- |
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/python/erc20_single_shot_faucet/faucet.py b/python/erc20_single_shot_faucet/faucet.py @@ -34,11 +34,18 @@ class Faucet: @staticmethod - def abi(): + def abi(part=None): if Faucet.__abi == None: f = open(os.path.join(datadir, 'ERC20SingleShotFaucet.abi.json'), 'r') Faucet.__abi = json.load(f) f.close() + if part == 'storage': + f = open(os.path.join(datadir, 'ERC20SingleShotFaucetStorage.abi.json')) + abi = f.read() + f.close() + return abi + elif part != None: + raise ValueError('unknown abi identifier "{}"'.format(part)) return Faucet.__abi