mirror of
git://holbrook.no/eth-contract-registry
synced 2026-05-17 01:55:20 +02:00
Correct interface in solidity contract
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
[{"inputs":[{"internalType":"bytes32[]","name":"_identifiers","type":"bytes32[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"}],"name":"chainOf","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_chain","type":"bytes32"}],"name":"configSumOf","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"identifiers","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"},{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32","name":"_chainDescriptor","type":"bytes32"},{"internalType":"bytes32","name":"_chainConfig","type":"bytes32"}],"name":"set","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
|
||||
[{"inputs":[{"internalType":"bytes32[]","name":"_identifiers","type":"bytes32[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"},{"internalType":"bytes32","name":"_reference","type":"bytes32"}],"name":"bind","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"identifiers","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_identifier","type":"bytes32"},{"internalType":"address","name":"_address","type":"address"}],"name":"set","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_sum","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
|
||||
|
||||
@@ -93,22 +93,14 @@ class ContractRegistry(Registry):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
def set(self, contract_address, sender_address, identifier_string, address, chain_spec, chain_config_hash):
|
||||
def set(self, contract_address, sender_address, identifier_string, address):
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('set')
|
||||
enc.typ(ABIContractType.BYTES32)
|
||||
enc.typ(ABIContractType.ADDRESS)
|
||||
enc.typ(ABIContractType.BYTES32)
|
||||
enc.typ(ABIContractType.BYTES32)
|
||||
identifier = to_identifier(identifier_string)
|
||||
enc.bytes32(identifier)
|
||||
enc.address(address)
|
||||
chain_str = str(chain_spec)
|
||||
h = hashlib.new('sha256')
|
||||
h.update(chain_str.encode('utf-8'))
|
||||
chain_description_hash_bytes = h.digest()
|
||||
enc.bytes32(chain_description_hash_bytes.hex())
|
||||
enc.bytes32(chain_config_hash)
|
||||
data = enc.encode()
|
||||
tx = self.template(sender_address, contract_address, use_nonce=True)
|
||||
tx = self.set_code(tx, data)
|
||||
|
||||
@@ -76,7 +76,7 @@ def main():
|
||||
raise ValueError('chain config hash must be 32 bytes')
|
||||
chain_config_hash = add_0x(chain_config_hash)
|
||||
|
||||
(tx_hash_hex, o) = c.set(registry_address, signer_address, config.get('_IDENTIFIER'), subject_address, chain_spec, chain_config_hash)
|
||||
(tx_hash_hex, o) = c.set(registry_address, signer_address, config.get('_IDENTIFIER'), subject_address)
|
||||
|
||||
if config.get('_RPC_SEND'):
|
||||
conn.do(o)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
confini>=0.3.6rc3,<0.5.0
|
||||
chainlib-eth>=0.0.9a3,<=0.1.0
|
||||
confini~=0.5.2
|
||||
chainlib-eth~=0.0.12
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = eth-contract-registry
|
||||
version = 0.6.3a3
|
||||
version = 0.7.1a2
|
||||
description = Ethereum Smart Contract key-value registry
|
||||
author = Louis Holbrook
|
||||
author_email = dev@holbrook.no
|
||||
|
||||
Reference in New Issue
Block a user