commit 5d6c2b43e54461df34fe2359e75701ce37e197ea
parent 13a81def57f738b4344304e271b5a5397c5307c2
Author: nolash <dev@holbrook.no>
Date: Tue, 15 Dec 2020 10:59:33 +0100
Add serial and requests accessors
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/python/erc20_approval_escrow/approval.py b/python/erc20_approval_escrow/approval.py
@@ -8,8 +8,7 @@ import logging
import json
import os
-logging.basicConfig(level=logging.DEBUG)
-logg = logging.getLogger()
+logg = logging.getLogger(__name__)
moddir = os.path.dirname(__file__)
datadir = os.path.join(moddir, 'data')
@@ -53,5 +52,16 @@ class TransferApproval:
return TransferApproval.__bytecode
+ def serial(self):
+ return self.contract.functions.serial().call()
+ def requests(self, idx):
+ req = self.contract.functions.requests(idx).call()
+ return {
+ 'serial': req[0],
+ 'sender': req[1],
+ 'recipient': req[2],
+ 'token': req[3],
+ 'value': req[4],
+ }