mirror of
git://holbrook.no/eth-address-index
synced 2024-11-16 06:26:46 +01:00
Reinstate entry by indexmethod
This commit is contained in:
parent
d3d731e76d
commit
16b84d4d0c
@ -1 +1 @@
|
||||
include **/data/TokenEndorser.json **/data/TokenEndorser.bin
|
||||
include **/data/*.json **/data/*.bin
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"entry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"},{"internalType":"address","name":"_token","type":"address"}],"name":"register","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"registry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
|
||||
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"entry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"},{"internalType":"address","name":"_token","type":"address"}],"name":"register","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"registry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceCode","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
|
||||
|
@ -70,7 +70,7 @@ class TokenUniqueSymbolIndex:
|
||||
|
||||
|
||||
def get_index(self, idx):
|
||||
return self.contract.functions.tokens(idx).call()
|
||||
return self.contract.functions.entry(idx).call()
|
||||
|
||||
|
||||
def get_token_by_symbol(self, symbol):
|
||||
|
@ -1,5 +1,5 @@
|
||||
[metadata]
|
||||
name = eth-address-declarator
|
||||
name = eth-address-index
|
||||
version = 0.0.1
|
||||
description = Signed metadata declarations for ethereum addresses
|
||||
author = Louis Holbrook
|
||||
@ -26,6 +26,8 @@ python_requires = >= 3.6
|
||||
packages =
|
||||
eth_address_declarator
|
||||
eth_address_declarator.runnable
|
||||
eth_token_index
|
||||
eth_token_index.runnable
|
||||
install_requires =
|
||||
web3==5.12.2
|
||||
tests_require =
|
||||
@ -41,8 +43,15 @@ testing =
|
||||
* =
|
||||
data/AddressDeclarator.json
|
||||
data/AddressDeclarator.bin
|
||||
data/GiftableToken.bin
|
||||
data/GifttableToken.json
|
||||
data/TokenUniqueSymbolIndex.bin
|
||||
data/TokenUniqueSymbolIndex.json
|
||||
data/ERC20.json
|
||||
|
||||
[options.entry_points]
|
||||
console_scripts =
|
||||
eth-address-declarator-deploy = eth_address_declarator.runnable.deploy:main
|
||||
eth-address-declarator-add = eth_address_declarator.runnable.add:main
|
||||
eth-token-index-deploy = eth_token_index.runnable.deploy:main
|
||||
eth-token-index-add = eth_token_index.runnable.add:main
|
||||
|
@ -95,6 +95,9 @@ class Test(unittest.TestCase):
|
||||
|
||||
assert ifc.count() == 2
|
||||
|
||||
assert ifc.get_index(0) == self.address_token_one
|
||||
assert ifc.get_index(1) == self.address_token_two
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"},{"internalType":"address","name":"_token","type":"address"}],"name":"register","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"registry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceCode","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
|
||||
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"}],"name":"addressOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_idx","type":"uint256"}],"name":"entry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"},{"internalType":"address","name":"_token","type":"address"}],"name":"register","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"registry","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceCode","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
|
||||
|
@ -26,6 +26,10 @@ contract TokenUniqueSymbolIndex {
|
||||
return false;
|
||||
}
|
||||
|
||||
function entry(uint256 _idx) public view returns ( address ) {
|
||||
return tokens[_idx + 1];
|
||||
}
|
||||
|
||||
// EIP 172
|
||||
function transferOwnership() public {
|
||||
revert("owner cannot be changed");
|
||||
|
Loading…
Reference in New Issue
Block a user