mirror of
git://holbrook.no/eth-address-index
synced 2024-11-30 11:56:45 +01:00
Move to chainlib-eth
This commit is contained in:
parent
3756ae28d9
commit
7634e5566d
@ -1,3 +1,6 @@
|
||||
- 0.1.2-pending
|
||||
* Move to chainlib-eth
|
||||
- 0.1.1-unreleased
|
||||
- 0.1.0-unreleased
|
||||
* Implement external signer
|
||||
* Standardize cli arg flags
|
||||
|
@ -23,7 +23,6 @@ from chainlib.eth.contract import (
|
||||
ABIContractType,
|
||||
abi_decode_single,
|
||||
)
|
||||
from chainlib.jsonrpc import jsonrpc_template
|
||||
from chainlib.eth.constant import ZERO_ADDRESS
|
||||
|
||||
# local imports
|
||||
|
@ -17,7 +17,7 @@ from chainlib.eth.contract import (
|
||||
ABIContractType,
|
||||
abi_decode_single,
|
||||
)
|
||||
from chainlib.jsonrpc import jsonrpc_template
|
||||
from chainlib.jsonrpc import JSONRPCRequest
|
||||
from chainlib.eth.constant import ZERO_ADDRESS
|
||||
|
||||
logg = logging.getLogger(__name__)
|
||||
@ -39,8 +39,9 @@ class Declarator(TxFactory):
|
||||
return tx
|
||||
|
||||
|
||||
def declarator_count(self, contract_address, subject_address, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def declarator_count(self, contract_address, subject_address, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('declaratorCount')
|
||||
@ -50,11 +51,13 @@ class Declarator(TxFactory):
|
||||
tx = self.template(sender_address, contract_address)
|
||||
tx = self.set_code(tx, data)
|
||||
o['params'].append(self.normalize(tx))
|
||||
o = j.finalize(o)
|
||||
return o
|
||||
|
||||
|
||||
def declaration(self, contract_address, declarator_address, subject_address, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def declaration(self, contract_address, declarator_address, subject_address, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('declaration')
|
||||
@ -66,11 +69,13 @@ class Declarator(TxFactory):
|
||||
tx = self.template(sender_address, contract_address)
|
||||
tx = self.set_code(tx, data)
|
||||
o['params'].append(self.normalize(tx))
|
||||
o = j.finalize(o)
|
||||
return o
|
||||
|
||||
|
||||
def declaration_address_at(self, contract_address, declarator_address, idx, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def declaration_address_at(self, contract_address, declarator_address, idx, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('declarationAddressAt')
|
||||
@ -82,11 +87,13 @@ class Declarator(TxFactory):
|
||||
tx = self.template(sender_address, contract_address)
|
||||
tx = self.set_code(tx, data)
|
||||
o['params'].append(self.normalize(tx))
|
||||
o = j.finalize(o)
|
||||
return o
|
||||
|
||||
|
||||
def declarator_address_at(self, contract_address, subject_address, idx, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def declarator_address_at(self, contract_address, subject_address, idx, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('declaratorAddressAt')
|
||||
@ -98,6 +105,7 @@ class Declarator(TxFactory):
|
||||
tx = self.template(sender_address, contract_address)
|
||||
tx = self.set_code(tx, data)
|
||||
o['params'].append(self.normalize(tx))
|
||||
o = j.finalize(o)
|
||||
return o
|
||||
|
||||
|
||||
|
@ -19,7 +19,7 @@ from chainlib.eth.tx import (
|
||||
TxFactory,
|
||||
TxFormat,
|
||||
)
|
||||
from chainlib.jsonrpc import jsonrpc_template
|
||||
from chainlib.jsonrpc import JSONRPCRequest
|
||||
from chainlib.eth.constant import ZERO_ADDRESS
|
||||
from hexathon import (
|
||||
add_0x,
|
||||
@ -85,8 +85,9 @@ class TokenUniqueSymbolIndex(TxFactory):
|
||||
return tx
|
||||
|
||||
|
||||
def address_of(self, contract_address, token_symbol, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def address_of(self, contract_address, token_symbol, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('addressOf')
|
||||
@ -97,11 +98,13 @@ class TokenUniqueSymbolIndex(TxFactory):
|
||||
tx = self.template(sender_address, contract_address)
|
||||
tx = self.set_code(tx, data)
|
||||
o['params'].append(self.normalize(tx))
|
||||
o = j.finalize(o)
|
||||
return o
|
||||
|
||||
|
||||
def entry(self, contract_address, idx, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def entry(self, contract_address, idx, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('entry')
|
||||
@ -111,11 +114,13 @@ class TokenUniqueSymbolIndex(TxFactory):
|
||||
tx = self.template(sender_address, contract_address)
|
||||
tx = self.set_code(tx, data)
|
||||
o['params'].append(self.normalize(tx))
|
||||
o = j.finalize(o)
|
||||
return o
|
||||
|
||||
|
||||
def entry_count(self, contract_address, sender_address=ZERO_ADDRESS):
|
||||
o = jsonrpc_template()
|
||||
def entry_count(self, contract_address, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
o['method'] = 'eth_call'
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('entryCount')
|
||||
@ -123,6 +128,7 @@ class TokenUniqueSymbolIndex(TxFactory):
|
||||
tx = self.template(sender_address, contract_address)
|
||||
tx = self.set_code(tx, data)
|
||||
o['params'].append(self.normalize(tx))
|
||||
o = j.finalize(o)
|
||||
return o
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
confini~=0.3.6rc3
|
||||
crypto-dev-signer~=0.4.14b3
|
||||
chainlib~=0.0.3a1
|
||||
eth_erc20~=0.0.9a1
|
||||
crypto-dev-signer~=0.4.14b6
|
||||
chainlib-eth~=0.0.5a1
|
||||
eth_erc20~=0.0.10a1
|
||||
|
12
python/run_tests.sh
Normal file
12
python/run_tests.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
for f in `ls tests/*.py`; do
|
||||
python $f
|
||||
if [ $? -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
set +x
|
||||
set +e
|
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = eth-address-index
|
||||
version = 0.1.1a12
|
||||
version = 0.1.2a1
|
||||
description = Signed metadata declarations for ethereum addresses
|
||||
author = Louis Holbrook
|
||||
author_email = dev@holbrook.no
|
||||
|
@ -1,3 +1,2 @@
|
||||
eth-tester==0.5.0b2
|
||||
eth-tester==0.5.0b3
|
||||
py-evm==0.3.0a20
|
||||
giftable-erc20-token==0.0.8a9
|
||||
|
Loading…
Reference in New Issue
Block a user