From 4fe1a81ce7e16413b01467a2f88058127941170e Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 21 Jul 2020 22:17:11 +0300 Subject: [PATCH] Add helpers for using Web3 types on the Confutils command-line --- web3/confutils_defs.nim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 web3/confutils_defs.nim diff --git a/web3/confutils_defs.nim b/web3/confutils_defs.nim new file mode 100644 index 0000000..2f4fc50 --- /dev/null +++ b/web3/confutils_defs.nim @@ -0,0 +1,17 @@ +import + ethtypes + +func parseCmdArg*(T: type Address, input: TaintedString): T + {.raises: [ValueError, Defect].} = + fromHex(T, string input) + +func completeCmdArg*(T: type Address, input: TaintedString): seq[string] = + return @[] + +func parseCmdArg*(T: type BlockHash, input: TaintedString): T + {.raises: [ValueError, Defect].} = + fromHex(T, string input) + +func completeCmdArg*(T: type BlockHash, input: TaintedString): seq[string] = + return @[] +