Skip to content

Commit 7168f30

Browse files
authored
Merge pull request #20 from Adamant-im/fix
Fix
2 parents 9dc79fa + bde920f commit 7168f30

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

create_tables.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ CREATE TABLE public.ethtxs
1414
contract_value citext,
1515
);
1616

17-
CREATE VIEW max_block as
17+
CREATE VIEW max_block as
1818
SELECT
19-
MAX(block)
19+
MAX(block),
20+
'2.4.0' as version
2021
FROM public.ethtxs;

ethsync.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Guénolé de Cadoudal ([email protected]), Drew Wells ([email protected])
77
# 2020-2021 ADAMANT Foundation ([email protected]): Aleksei Lebedev
88
# 2017-2020 ADAMANT TECH LABS LP ([email protected]): Artem Brunov, Aleksei Lebedev
9-
# v2.1
9+
# v2.4
1010

1111
from os import environ
1212
from web3 import Web3
@@ -58,7 +58,7 @@
5858
logger.addHandler(lfh)
5959

6060
# Systemd logger, if we want to user journalctl logs
61-
# Install systemd-python and
61+
# Install systemd-python and
6262
# decomment "#from systemd.journal import JournalHandler" up
6363
#ljc = JournalHandler()
6464
#formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
@@ -112,8 +112,8 @@ def insertTxsFromBlock(block):
112112
contract_value = ''
113113
# Check if transaction is a contract transfer
114114
if inputinfo.hex().startswith('0xa9059cbb'):
115-
contract_to = inputinfo[10:-64]
116-
contract_value = inputinfo[74:]
115+
contract_to = inputinfo.hex()[10:-64]
116+
contract_value = inputinfo.hex()[74:]
117117
# Correct contract transfer transaction represents '0x' + 4 bytes 'a9059cbb' + 32 bytes (64 chars) for contract address and 32 bytes for its value
118118
# Some buggy txs can break up Indexer, so we'll filter it
119119
if len(contract_to) > 128:
@@ -141,7 +141,7 @@ def insertTxsFromBlock(block):
141141
maxblockindb = int(startBlock)
142142

143143
endblock = int(web3.eth.block_number) - int(confirmationBlocks)
144-
144+
145145
logger.info('Current best block in index: ' + str(maxblockindb) + '; in Ethereum chain: ' + str(endblock))
146146

147147
for blockHeight in range(maxblockindb + 1, endblock):

0 commit comments

Comments
 (0)