From 40730bba4b9937629670d389b4b5c7042b617a3c Mon Sep 17 00:00:00 2001 From: nolash Date: Sat, 28 Aug 2021 12:43:53 +0200 Subject: [PATCH] Add missing package file encode --- apps/cic-eth/cic_eth/encode.py | 16 ++++++++++++++++ apps/data-seeding/requirements.txt | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 apps/cic-eth/cic_eth/encode.py diff --git a/apps/cic-eth/cic_eth/encode.py b/apps/cic-eth/cic_eth/encode.py new file mode 100644 index 00000000..3d814861 --- /dev/null +++ b/apps/cic-eth/cic_eth/encode.py @@ -0,0 +1,16 @@ +# external imports +from chainlib.eth.constant import ZERO_ADDRESS +from chainqueue.encode import TxHexNormalizer +from chainlib.eth.tx import unpack + +tx_normalize = TxHexNormalizer() + +ZERO_ADDRESS_NORMAL = tx_normalize.wallet_address(ZERO_ADDRESS) + + +def unpack_normal(signed_tx_bytes, chain_spec): + tx = unpack(signed_tx_bytes, chain_spec) + tx['hash'] = tx_normalize.tx_hash(tx['hash']) + tx['from'] = tx_normalize.wallet_address(tx['from']) + tx['to'] = tx_normalize.wallet_address(tx['to']) + return tx diff --git a/apps/data-seeding/requirements.txt b/apps/data-seeding/requirements.txt index ab23b3c7..623eee78 100644 --- a/apps/data-seeding/requirements.txt +++ b/apps/data-seeding/requirements.txt @@ -1,9 +1,9 @@ sarafu-faucet~=0.0.7a1 -cic-eth[tools]~=0.12.4a4 +cic-eth[tools]~=0.12.4a7 cic-types~=0.1.0a14 crypto-dev-signer>=0.4.15a1,<=0.4.15 faker==4.17.1 -chainsyncer~=0.0.6a1 +chainsyncer~=0.0.6a3 chainlib-eth~=0.0.9a7 eth-address-index~=0.2.3a4 eth-contract-registry~=0.6.3a3