Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbd4ed6526 | ||
| b7acbdc4bc | |||
|
|
3361f90ae1 | ||
| 37188a60e8 | |||
|
|
fb1ebcf8cd | ||
| 38cfb18527 | |||
| c84517e3db | |||
| dcea763ce5 | |||
| e55b82f529 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -2,6 +2,21 @@
|
||||
|
||||
<!--next-version-placeholder-->
|
||||
|
||||
## v0.4.0 (2022-04-29)
|
||||
### Feature
|
||||
* Add giftable generation ([`b7acbdc`](https://git.grassecon.net/cicnet/cic-cli/commit/b7acbdc4bc5862752585fecfaee7d2fe70d8dbbe))
|
||||
|
||||
## v0.3.4 (2022-04-27)
|
||||
### Fix
|
||||
* Bump deps again ([`37188a6`](https://git.grassecon.net/cicnet/cic-cli/commit/37188a60e85d9545acfd950c1c160801c22d2b5b))
|
||||
|
||||
## v0.3.3 (2022-04-26)
|
||||
### Fix
|
||||
* It's ok if you already exsist ([`38cfb18`](https://git.grassecon.net/cicnet/cic-cli/commit/38cfb185270fb361ff5d9da9976745e1fecc40f8))
|
||||
* Take the reins off ([`c84517e`](https://git.grassecon.net/cicnet/cic-cli/commit/c84517e3db264f541e6e5a8eef30703bf28d32d0))
|
||||
* Bump deps ([`dcea763`](https://git.grassecon.net/cicnet/cic-cli/commit/dcea763ce5b3d542ed0a50586720fc3a45142e77))
|
||||
* **attachement:** Directory not getting created ([`e55b82f`](https://git.grassecon.net/cicnet/cic-cli/commit/e55b82f5295397b3e4123297bc6b231ca251bc83))
|
||||
|
||||
## v0.3.2 (2022-04-26)
|
||||
### Fix
|
||||
* Update deps ([`d2e55fa`](https://git.grassecon.net/cicnet/cic-cli/commit/d2e55fad0efd13fa7a1de8ed8ab43e703a4aa046))
|
||||
|
||||
@@ -1 +1 @@
|
||||
__version__ = "0.3.2"
|
||||
__version__ = "0.4.0"
|
||||
|
||||
@@ -23,12 +23,12 @@ class Attachment(Data):
|
||||
self.path = path
|
||||
self.writer = writer
|
||||
self.attachment_path = os.path.join(self.path, "attachments")
|
||||
self.start()
|
||||
if interactive:
|
||||
self.start()
|
||||
input(
|
||||
f"Please add attachment files to '{os.path.abspath(os.path.join(self.path,'attachments'))}' and then press ENTER to continue"
|
||||
)
|
||||
self.load()
|
||||
self.load()
|
||||
|
||||
def load(self):
|
||||
"""Loads attachment data from settings."""
|
||||
@@ -45,7 +45,7 @@ class Attachment(Data):
|
||||
def start(self):
|
||||
"""Initialize attachment settings from template."""
|
||||
super(Attachment, self).start()
|
||||
os.makedirs(self.attachment_path)
|
||||
os.makedirs(self.attachment_path, exist_ok=True)
|
||||
|
||||
def get(self, k):
|
||||
"""Get a single attachment by the sha256 hash of the content.
|
||||
|
||||
@@ -11,7 +11,7 @@ from cic.contract.components.attachment import Attachment
|
||||
from cic.contract.components.meta import Meta
|
||||
from cic.contract.components.proof import Proof
|
||||
from cic.contract.components.token import Token
|
||||
from cic.contract.constants import DMR_CONTRACT_URL
|
||||
from cic.contract.constants import DMR_CONTRACT_URL, GITABLE_CONTRACT_URL
|
||||
from cic.contract.contract import Contract
|
||||
from cic.contract.helpers import download_file
|
||||
from cic.contract.network import Network
|
||||
@@ -59,7 +59,6 @@ def load_contracts_from_csv(config, directory, csv_path: str) -> List[Contract]:
|
||||
targets = ["eth"]
|
||||
os.makedirs(directory)
|
||||
contract_rows = []
|
||||
bin_path = os.path.abspath(download_file(DMR_CONTRACT_URL + ".bin"))
|
||||
with open(csv_path, "rt", encoding="utf-8") as file:
|
||||
csvreader = csv.reader(file, delimiter=",")
|
||||
for idx, row in enumerate(csvreader):
|
||||
@@ -88,22 +87,38 @@ def load_contracts_from_csv(config, directory, csv_path: str) -> List[Contract]:
|
||||
sink_account = contract_row[CSV_Column.sink_account]
|
||||
description = contract_row[CSV_Column.description]
|
||||
|
||||
if token_type != "demurrage":
|
||||
raise Exception(
|
||||
f"Only demurrage tokens are supported at this time. {token_type} is not supported"
|
||||
if token_type == "demurrage":
|
||||
bin_path = os.path.abspath(download_file(DMR_CONTRACT_URL + ".bin"))
|
||||
log.info(f"Generating {token_type} contract for {issuer}")
|
||||
token = Token(
|
||||
directory,
|
||||
name=voucher_name,
|
||||
symbol=symbol,
|
||||
precision=precision,
|
||||
supply=supply,
|
||||
extra_args=[demurrage, period_minutes, sink_account],
|
||||
extra_args_types=["uint256", "uint256", "address"],
|
||||
code=bin_path,
|
||||
)
|
||||
elif token_type == "giftable":
|
||||
bin_path = os.path.abspath(download_file(GITABLE_CONTRACT_URL + ".bin"))
|
||||
token = Token(
|
||||
directory,
|
||||
name=voucher_name,
|
||||
symbol=symbol,
|
||||
precision=precision,
|
||||
supply=supply,
|
||||
extra_args=[],
|
||||
extra_args_types=[],
|
||||
code=bin_path,
|
||||
)
|
||||
else:
|
||||
raise Exception(
|
||||
f"Only demurrage and gitable contracts currently supported at this time. {token_type} is not supported"
|
||||
)
|
||||
if token is None:
|
||||
raise Exception(f"There was an issue building the contract")
|
||||
|
||||
log.info("Generating token")
|
||||
token = Token(
|
||||
directory,
|
||||
name=voucher_name,
|
||||
symbol=symbol,
|
||||
precision=precision,
|
||||
supply=supply,
|
||||
extra_args=[demurrage, period_minutes, sink_account],
|
||||
extra_args_types=["uint256", "uint256", "address"],
|
||||
code=bin_path,
|
||||
)
|
||||
token.start()
|
||||
|
||||
log.info("Generating proof")
|
||||
|
||||
209
poetry.lock
generated
209
poetry.lock
generated
@@ -137,7 +137,7 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "cbor2"
|
||||
version = "5.4.1"
|
||||
version = "5.4.2.post1"
|
||||
description = "Pure Python CBOR (de)serializer with extensive tag support"
|
||||
category = "main"
|
||||
optional = false
|
||||
@@ -149,8 +149,8 @@ test = ["pytest", "pytest-cov"]
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
url = "https://pip.grassrootseconomics.net"
|
||||
reference = "grassroots_"
|
||||
url = "https://pypi.org/simple"
|
||||
reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "certifi"
|
||||
@@ -183,14 +183,14 @@ reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "chainlib"
|
||||
version = "0.0.23"
|
||||
version = "0.1.0"
|
||||
description = "Generic blockchain access library and tooling"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
|
||||
[package.dependencies]
|
||||
confini = ">=0.5.7,<0.6.0"
|
||||
confini = ">=0.6.0,<0.7.0"
|
||||
funga = ">=0.5.2,<0.6.0"
|
||||
hexathon = ">=0.1.5,<0.2.0"
|
||||
pysha3 = "1.0.2"
|
||||
@@ -200,21 +200,21 @@ xdg = ["pyxdg (>=0.27,<1.0)"]
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
url = "https://pip.grassrootseconomics.net"
|
||||
reference = "grassroots_"
|
||||
url = "https://pypi.org/simple"
|
||||
reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "chainlib-eth"
|
||||
version = "0.0.27"
|
||||
version = "0.1.1"
|
||||
description = "Ethereum implementation of the chainlib interface"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib = ">=0.0.23,<0.1.0"
|
||||
confini = ">=0.5.7,<0.6.0"
|
||||
funga-eth = ">=0.5.6,<0.6.0"
|
||||
chainlib = ">=0.1.0,<0.2.0"
|
||||
confini = ">=0.6.0,<0.7.0"
|
||||
funga-eth = ">=0.6.0,<0.7.0"
|
||||
hexathon = ">=0.1.5,<0.2.0"
|
||||
potaahto = ">=0.1.1,<0.2.0"
|
||||
pysha3 = "1.0.2"
|
||||
@@ -243,14 +243,14 @@ reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "cic-contracts"
|
||||
version = "0.0.5"
|
||||
version = "0.1.0"
|
||||
description = "CIC network smart contract interfaces"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.12,<0.1.0"
|
||||
chainlib-eth = ">=0.1.0b1,<0.2.0"
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
@@ -259,21 +259,25 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "cic-eth-registry"
|
||||
version = "0.6.6"
|
||||
version = "0.6.9"
|
||||
description = "Contract registry"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.15,<0.1.0"
|
||||
confini = ">=0.5.3,<0.6.0"
|
||||
eth-accounts-index = ">=0.1.2,<0.2.0"
|
||||
eth-contract-registry = ">=0.7.2,<0.8.0"
|
||||
eth-erc20 = ">=0.1.5,<0.2.0"
|
||||
eth-token-index = ">=0.2.4,<0.3.0"
|
||||
funga-eth = ">=0.5.1,<0.6.0"
|
||||
okota = ">=0.2.5,<0.3.0"
|
||||
chainlib-eth = ">=0.0.1b1,<0.2.0"
|
||||
confini = ">=0.6.0,<0.7.0"
|
||||
erc20-transfer-authorization = ">=0.4.0,<0.5.0"
|
||||
eth-accounts-index = ">=0.2.0,<0.3.0"
|
||||
eth-contract-registry = ">=0.8.0,<0.9.0"
|
||||
eth-erc20 = ">=0.3.0,<0.4.0"
|
||||
eth-token-index = ">=0.3.0,<0.4.0"
|
||||
funga-eth = ">=0.6.0,<0.7.0"
|
||||
okota = ">=0.4.0,<0.5.0"
|
||||
|
||||
[package.extras]
|
||||
pytest = ["eth_tester (==0.5.0b3)", "py-evm (==0.3.0a20)", "eth-address-index (>=0.5.0,<0.6.0)", "erc20-faucet (>=0.4.0,<0.5.0)", "erc20-transfer-authorization (>=0.4.0,<0.5.0)", "pytest (==6.0.1)"]
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
@@ -282,14 +286,14 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "cic-types"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
description = "Defines descriptors for data objects specific to the CIC-Network."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.14,<0.1.0"
|
||||
chainlib-eth = ">=0.1.0,<0.2.0"
|
||||
jsonschema = "3.2.0"
|
||||
phonenumbers = "8.12.12"
|
||||
python-gnupg = "0.4.7"
|
||||
@@ -366,7 +370,7 @@ reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "confini"
|
||||
version = "0.5.7"
|
||||
version = "0.6.0"
|
||||
description = "Parse, verify and merge all ini files in a single directory"
|
||||
category = "main"
|
||||
optional = false
|
||||
@@ -377,8 +381,8 @@ python-gnupg = ">=0.4.6,<0.5.0"
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
url = "https://pip.grassrootseconomics.net"
|
||||
reference = "grassroots_"
|
||||
url = "https://pypi.org/simple"
|
||||
reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "coverage"
|
||||
@@ -398,14 +402,14 @@ reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "cryptography"
|
||||
version = "3.2.1"
|
||||
version = "3.3"
|
||||
description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers."
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*"
|
||||
python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*"
|
||||
|
||||
[package.dependencies]
|
||||
cffi = ">=1.8,<1.11.3 || >1.11.3"
|
||||
cffi = ">=1.12"
|
||||
six = ">=1.4.1"
|
||||
|
||||
[package.extras]
|
||||
@@ -417,8 +421,8 @@ test = ["pytest (>=3.6.0,!=3.9.0,!=3.9.1,!=3.9.2)", "pretend", "iso8601", "pytz"
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
url = "https://pip.grassrootseconomics.net"
|
||||
reference = "grassroots_"
|
||||
url = "https://pypi.org/simple"
|
||||
reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "cytoolz"
|
||||
@@ -484,6 +488,24 @@ type = "legacy"
|
||||
url = "https://pypi.org/simple"
|
||||
reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "erc20-transfer-authorization"
|
||||
version = "0.4.0"
|
||||
description = "Simple approval escrow for ERC20 spend approval"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.1.0b1,<0.2.0"
|
||||
confini = ">=0.5.2,<0.7.0"
|
||||
potaahto = ">=0.1.1,<0.2.0"
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
url = "https://pip.grassrootseconomics.net"
|
||||
reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "eth-abi"
|
||||
version = "2.1.1"
|
||||
@@ -511,15 +533,15 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "eth-accounts-index"
|
||||
version = "0.1.5"
|
||||
version = "0.2.0"
|
||||
description = "Accounts index evm contract tooling with permissioned writes"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.10,<=0.1.0"
|
||||
confini = ">=0.5.6,<0.6.0"
|
||||
chainlib-eth = ">=0.1.0b1,<0.2.0"
|
||||
confini = ">=0.5.6,<0.7.0"
|
||||
|
||||
[package.extras]
|
||||
testing = ["pytest (==6.0.1)", "eth-tester (==0.5.0b2)", "py-evm (==0.3.0a20)"]
|
||||
@@ -531,15 +553,15 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "eth-address-index"
|
||||
version = "0.2.5"
|
||||
version = "0.5.0"
|
||||
description = "Signed metadata declarations for ethereum addresses"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.22,<0.1.0"
|
||||
confini = ">=0.5.2,<0.6.0"
|
||||
chainlib-eth = ">=0.1.0b1,<0.2.0"
|
||||
confini = ">=0.6.0,<0.7.0"
|
||||
|
||||
[package.extras]
|
||||
dev = ["eth-tester (==0.5.0b3)", "py-evm (==0.3.0a20)", "eth-accounts-index (>=0.1.3,<0.2.0)", "eth_erc20 (>=0.1.5,<0.2.0)"]
|
||||
@@ -573,15 +595,15 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "eth-contract-registry"
|
||||
version = "0.7.2"
|
||||
version = "0.8.0"
|
||||
description = "Ethereum Smart Contract key-value registry"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.12,<0.1.0"
|
||||
confini = ">=0.5.2,<0.6.0"
|
||||
chainlib-eth = ">=0.1.0b1,<0.2.0"
|
||||
confini = ">=0.6.0,<0.7.0"
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
@@ -590,15 +612,15 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "eth-erc20"
|
||||
version = "0.1.11"
|
||||
version = "0.3.0"
|
||||
description = "ERC20 interface and simple contract with deployment script that lets any address mint and gift itself tokens."
|
||||
category = "main"
|
||||
optional = false
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.23,<=0.1.0"
|
||||
confini = ">=0.5.6,<0.6.0"
|
||||
chainlib-eth = ">=0.1.0b1,<0.2.0"
|
||||
confini = ">=0.5.7,<0.7.0"
|
||||
potaahto = ">=0.1.1,<0.2.0"
|
||||
|
||||
[package.source]
|
||||
@@ -683,16 +705,16 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "eth-token-index"
|
||||
version = "0.2.6"
|
||||
version = "0.3.0"
|
||||
description = "Token symbol to address unique index"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.10,<=0.1.0"
|
||||
confini = ">=0.5.6,<0.6.0"
|
||||
eth_erc20 = ">=0.1.11,<0.2.0"
|
||||
chainlib-eth = ">=0.1.0b1,<0.2.0"
|
||||
confini = ">=0.6.0,<0.7.0"
|
||||
eth_erc20 = ">=0.3.0,<0.4.0"
|
||||
|
||||
[package.extras]
|
||||
testing = ["eth-tester (==0.5.0b2)", "py-evm (==0.3.0a20)"]
|
||||
@@ -761,7 +783,7 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "funga-eth"
|
||||
version = "0.5.6"
|
||||
version = "0.6.0"
|
||||
description = "Ethereum implementation of the funga keystore and signer"
|
||||
category = "main"
|
||||
optional = false
|
||||
@@ -769,10 +791,10 @@ python-versions = "*"
|
||||
|
||||
[package.dependencies]
|
||||
coincurve = "15.0.0"
|
||||
confini = ">=0.5.1,<0.6.0"
|
||||
cryptography = "3.2.1"
|
||||
confini = ">=0.6.0,<0.7.0"
|
||||
cryptography = "3.3"
|
||||
funga = "0.5.2"
|
||||
hexathon = ">=0.1.0,<0.2.0"
|
||||
hexathon = ">=0.1.5,<0.2.0"
|
||||
json-rpc = "1.13.0"
|
||||
pycryptodome = "3.10.1"
|
||||
pysha3 = "1.0.2"
|
||||
@@ -783,8 +805,8 @@ sql = ["psycopg2 (==2.8.6)", "sqlalchemy (==1.3.20)"]
|
||||
|
||||
[package.source]
|
||||
type = "legacy"
|
||||
url = "https://pip.grassrootseconomics.net"
|
||||
reference = "grassroots_"
|
||||
url = "https://pypi.org/simple"
|
||||
reference = "pypi_"
|
||||
|
||||
[[package]]
|
||||
name = "gitdb"
|
||||
@@ -1058,22 +1080,21 @@ reference = "grassroots_"
|
||||
|
||||
[[package]]
|
||||
name = "okota"
|
||||
version = "0.2.7"
|
||||
version = "0.4.0"
|
||||
description = "Registries for CIC using the eth-address-index backend"
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3.6"
|
||||
|
||||
[package.dependencies]
|
||||
chainlib-eth = ">=0.0.15,<0.1.0"
|
||||
cic-contracts = ">=0.0.5,<0.1.0"
|
||||
confini = ">=0.5.3,<0.6.0"
|
||||
eth-accounts-index = ">=0.1.2,<0.2.0"
|
||||
eth-address-index = ">=0.2.4,<0.3.0"
|
||||
eth-contract-registry = ">=0.7.2,<0.8.0"
|
||||
eth_erc20 = ">=0.1.5,<0.2.0"
|
||||
eth-token-index = ">=0.2.4,<0.3.0"
|
||||
funga-eth = ">=0.5.1,<0.6.0"
|
||||
chainlib-eth = ">=0.1.0b1,<0.2.0"
|
||||
cic-contracts = ">=0.1.0,<0.2.0"
|
||||
confini = ">=0.6.0,<0.7.0"
|
||||
eth-accounts-index = ">=0.2.0,<0.3.0"
|
||||
eth-address-index = ">=0.5.0,<0.6.0"
|
||||
eth-contract-registry = ">=0.8.0,<0.9.0"
|
||||
eth_erc20 = ">=0.3.0,<0.4.0"
|
||||
funga-eth = ">=0.6.0,<0.7.0"
|
||||
|
||||
[package.extras]
|
||||
testing = ["eth-tester (==0.5.0b2)", "py-evm (==0.3.0a20)"]
|
||||
@@ -1975,12 +1996,12 @@ url = "https://pypi.org/simple"
|
||||
reference = "pypi_"
|
||||
|
||||
[extras]
|
||||
eth = ["chainlib-eth", "eth-token-index", "eth-address-index", "okota", "cic_eth_registry", "cic_contracts"]
|
||||
eth = ["chainlib-eth", "eth-token-index", "eth-address-index", "okota", "cic-eth-registry", "cic-contracts"]
|
||||
|
||||
[metadata]
|
||||
lock-version = "1.1"
|
||||
python-versions = "^3.8"
|
||||
content-hash = "b8e29fc12298dcf81b596609dfccfb5ec4487fe79e212443cf10748742cb9d82"
|
||||
content-hash = "79c80546a5f7d9ccca6cae36b40940b7fd6365a007aa2aa1eae1bd7423b5f0e2"
|
||||
|
||||
[metadata.files]
|
||||
asn1crypto = [
|
||||
@@ -2027,7 +2048,29 @@ bleach = [
|
||||
{file = "bleach-5.0.0.tar.gz", hash = "sha256:c6d6cc054bdc9c83b48b8083e236e5f00f238428666d2ce2e083eaa5fd568565"},
|
||||
]
|
||||
cached-property = []
|
||||
cbor2 = []
|
||||
cbor2 = [
|
||||
{file = "cbor2-5.4.2.post1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:21a8778a92fae2fa713dfee2dc781fce64bc8fcb2e085368eff3a0b3434f83c7"},
|
||||
{file = "cbor2-5.4.2.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c55b683d2e84df1da6db527faac12a9b2b844a80c0a7864088c1aaf07e4ad1d4"},
|
||||
{file = "cbor2-5.4.2.post1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8b0455854dc53d816518ec5c117bf159b8d23d178ff8f655e3290192878264d5"},
|
||||
{file = "cbor2-5.4.2.post1-cp310-cp310-win_amd64.whl", hash = "sha256:566b6f85fd8caf85b34b75dd7056dd0ae076334af4def0e27da805c10f941ae1"},
|
||||
{file = "cbor2-5.4.2.post1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:92126b8fb5b20aa7167a5c0a84bb9562f54004af06ef601d05897dcad8a926f0"},
|
||||
{file = "cbor2-5.4.2.post1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c5e01b12a2f9172d31e096d65c1965a5b3b95bdb1ca91feb89741e6ce6a533a"},
|
||||
{file = "cbor2-5.4.2.post1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:6930fe3f83d5f4d9f83baf9a225651591e2f97ae04579bac6598c9520f71bbcc"},
|
||||
{file = "cbor2-5.4.2.post1-cp36-cp36m-win_amd64.whl", hash = "sha256:1e4f694b135688d6126988af602409e1d94dcdefbb7b242b56ba3a09779930fb"},
|
||||
{file = "cbor2-5.4.2.post1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:7c2a4336becc4021777df04371f119d74cf83befb604fb4e62cfb2d50dac9fbd"},
|
||||
{file = "cbor2-5.4.2.post1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:231cba333cbac0e8912042f04e78b3f8eacde8ee08777e197f10f7a2e42c43af"},
|
||||
{file = "cbor2-5.4.2.post1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e497c91bf107490503c1d834a04ccfc849d8b0b36ff8ee1598f10712864a4c87"},
|
||||
{file = "cbor2-5.4.2.post1-cp37-cp37m-win_amd64.whl", hash = "sha256:92e40496c33de912f16f275b88e063073343b39faa63a6d10deb6fdf5127ae44"},
|
||||
{file = "cbor2-5.4.2.post1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:565fe95a720b2e999cb56d19d1d309097930144f0c85eed34a058c14cf3ac897"},
|
||||
{file = "cbor2-5.4.2.post1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d140b20b0bcbdfa80a910c6832aaa13f870b7045e39f8d9b5b652ef87ce3eac5"},
|
||||
{file = "cbor2-5.4.2.post1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:85c048f5fc170b619127c0eb2dcc7bc832e982e3cefbaec19c028afe0d231864"},
|
||||
{file = "cbor2-5.4.2.post1-cp38-cp38-win_amd64.whl", hash = "sha256:75621aaa144e5f51bea3a1c753bad11ed7f3669a086222d09975953b5df6b0bf"},
|
||||
{file = "cbor2-5.4.2.post1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1c924fefd4fc7419a87463186c0c0ffc65c88635e813e02eff98751c49e43ab0"},
|
||||
{file = "cbor2-5.4.2.post1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a54b9cfe5ddfc7d1199d2a9e37e799c0c2b01385ce837b80feaeaf912d4797f2"},
|
||||
{file = "cbor2-5.4.2.post1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:53239908e4e80395dada750f612536dab9d4f09b9a419479b4d69e1e2419656f"},
|
||||
{file = "cbor2-5.4.2.post1-cp39-cp39-win_amd64.whl", hash = "sha256:1621f53af3b8016c991f9e27123efae54006cf57c321693f234fec9636c55d6b"},
|
||||
{file = "cbor2-5.4.2.post1.tar.gz", hash = "sha256:9cf21d59604b9529d7877c8e0342a2ebaae1a07fe8ff5683dc75fec15847c797"},
|
||||
]
|
||||
certifi = []
|
||||
cffi = [
|
||||
{file = "cffi-1.15.0-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:c2502a1a03b6312837279c8c1bd3ebedf6c12c4228ddbad40912d671ccc8a962"},
|
||||
@@ -2081,7 +2124,9 @@ cffi = [
|
||||
{file = "cffi-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:3773c4d81e6e818df2efbc7dd77325ca0dcb688116050fb2b3011218eda36139"},
|
||||
{file = "cffi-1.15.0.tar.gz", hash = "sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954"},
|
||||
]
|
||||
chainlib = []
|
||||
chainlib = [
|
||||
{file = "chainlib-0.1.0.tar.gz", hash = "sha256:22c5483b54b68333d2df539b809362a74b344d4028177a6390c2a328beab44d6"},
|
||||
]
|
||||
chainlib-eth = []
|
||||
charset-normalizer = [
|
||||
{file = "charset-normalizer-2.0.12.tar.gz", hash = "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597"},
|
||||
@@ -2103,7 +2148,9 @@ colorama = [
|
||||
{file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"},
|
||||
{file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"},
|
||||
]
|
||||
confini = []
|
||||
confini = [
|
||||
{file = "confini-0.6.0.tar.gz", hash = "sha256:c4f9cd9d7501c3e3647be5c30d0d3bd4803f79bf29b0c9e91729731631603fb5"},
|
||||
]
|
||||
coverage = [
|
||||
{file = "coverage-6.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9b27d894748475fa858f9597c0ee1d4829f44683f3813633aaf94b19cb5453cf"},
|
||||
{file = "coverage-6.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:37d1141ad6b2466a7b53a22e08fe76994c2d35a5b6b469590424a9953155afac"},
|
||||
@@ -2147,7 +2194,22 @@ coverage = [
|
||||
{file = "coverage-6.3.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:18d520c6860515a771708937d2f78f63cc47ab3b80cb78e86573b0a760161faf"},
|
||||
{file = "coverage-6.3.2.tar.gz", hash = "sha256:03e2a7826086b91ef345ff18742ee9fc47a6839ccd517061ef8fa1976e652ce9"},
|
||||
]
|
||||
cryptography = []
|
||||
cryptography = [
|
||||
{file = "cryptography-3.3-cp27-cp27m-macosx_10_10_x86_64.whl", hash = "sha256:41892759f13c7dfc329573cabd3a513f1e7b5d309ca55c931ffefc3b2f304899"},
|
||||
{file = "cryptography-3.3-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:4935d0603b118dc036c477917e5e8a020f7309bc11c363a4d572407dcbd53c80"},
|
||||
{file = "cryptography-3.3-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:2c28e69e8c2620869425420e466b224d351d5dc242d3e3293062cffa7fcdd276"},
|
||||
{file = "cryptography-3.3-cp27-cp27m-win32.whl", hash = "sha256:ee0084f6d62f083316b08111b122dc4fbe16e534059b92b5ddc3d73dc52dd39c"},
|
||||
{file = "cryptography-3.3-cp27-cp27m-win_amd64.whl", hash = "sha256:f43d6e72e3cdf983b5e5e65938c0519ce4eeb42b6af766f714b1414ae7b9f8ef"},
|
||||
{file = "cryptography-3.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:651eff09297e4518287f711b4e28523567cbde7beaa794d06d0b35ac9adc1172"},
|
||||
{file = "cryptography-3.3-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:1366e6fff96bb1d320e3ef3c531b0428cb780c517b6059ffe8820e2a30bf5858"},
|
||||
{file = "cryptography-3.3-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:66f41aa7642f97d35976750a2c0a6d5915733ba6c9ca7a0f327e56f037c1236e"},
|
||||
{file = "cryptography-3.3-cp36-abi3-manylinux1_x86_64.whl", hash = "sha256:9518da854136181407d946b971dd27a0e941d5d07f87f87a44c598b3da7a77d2"},
|
||||
{file = "cryptography-3.3-cp36-abi3-manylinux2010_x86_64.whl", hash = "sha256:ad8dc319f876273b474a59797344d5986beaaaf18f7cc0ab9255155da057d979"},
|
||||
{file = "cryptography-3.3-cp36-abi3-manylinux2014_aarch64.whl", hash = "sha256:55574bd84ff551fd6f7617e5eeda0b2d129f84788340ab57904f0c7f13f8f149"},
|
||||
{file = "cryptography-3.3-cp36-abi3-win32.whl", hash = "sha256:f95ca692fafea80f1815bbfecf57c6833c0b21432d17026a077341debee76e79"},
|
||||
{file = "cryptography-3.3-cp36-abi3-win_amd64.whl", hash = "sha256:402273e7f78e01f5c42452acef56bd52fa73fa0f312e4160db7ad29bbc90335d"},
|
||||
{file = "cryptography-3.3.tar.gz", hash = "sha256:d9f1e520f2ee08c5a88e1ae0b31159bdb13da40a486bea3e9f7d338564850ea6"},
|
||||
]
|
||||
cytoolz = []
|
||||
dill = [
|
||||
{file = "dill-0.3.4-py2.py3-none-any.whl", hash = "sha256:7e40e4a70304fd9ceab3535d36e58791d9c4a776b38ec7f7ec9afc8d3dca4d4f"},
|
||||
@@ -2160,6 +2222,7 @@ docutils = [
|
||||
dotty-dict = [
|
||||
{file = "dotty_dict-1.3.0.tar.gz", hash = "sha256:eb0035a3629ecd84397a68f1f42f1e94abd1c34577a19cd3eacad331ee7cbaf0"},
|
||||
]
|
||||
erc20-transfer-authorization = []
|
||||
eth-abi = []
|
||||
eth-accounts-index = []
|
||||
eth-address-index = []
|
||||
@@ -2179,7 +2242,9 @@ eth-typing = [
|
||||
]
|
||||
eth-utils = []
|
||||
funga = []
|
||||
funga-eth = []
|
||||
funga-eth = [
|
||||
{file = "funga-eth-0.6.0.tar.gz", hash = "sha256:47846faef6ac57049cac29fecaaf7684c0032d53f8f43cf807921eb2fdb63cc7"},
|
||||
]
|
||||
gitdb = [
|
||||
{file = "gitdb-4.0.9-py3-none-any.whl", hash = "sha256:8033ad4e853066ba6ca92050b9df2f89301b8fc8bf7e9324d412a63f8bf1a8fd"},
|
||||
{file = "gitdb-4.0.9.tar.gz", hash = "sha256:bac2fd45c0a1c9cf619e63a90d62bdc63892ef92387424b855792a6cabe789aa"},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "cic-cli"
|
||||
version = "0.3.2"
|
||||
version = "0.4.0"
|
||||
description = "Generic cli tooling for the CIC token network"
|
||||
authors = [
|
||||
"Louis Holbrook <dev@holbrook.no>",
|
||||
@@ -41,18 +41,18 @@ secondary = true
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.8"
|
||||
funga-eth = "~0.5.5"
|
||||
cic-types = "~0.2.1"
|
||||
confini = "~0.5.3"
|
||||
chainlib = "~0.0.17"
|
||||
cbor2 = "5.4.1"
|
||||
funga-eth = "^0.6.0"
|
||||
cic-types = "^0.2.2"
|
||||
confini = "^0.6.0"
|
||||
chainlib = "~0.1.0"
|
||||
cbor2 = "~5.4.1"
|
||||
|
||||
chainlib-eth = { version = "~0.0.25", optional = true }
|
||||
eth-token-index = { version = "~0.2.4", optional = true }
|
||||
eth-address-index = { version = "~0.2.4", optional = true }
|
||||
okota = { version = "~0.2.5", optional = true }
|
||||
cic_eth_registry = { version = "~0.6.6", optional = true }
|
||||
cic_contracts = { version = "~0.0.5", optional = true }
|
||||
chainlib-eth = { version = "~0.1.1", optional = true }
|
||||
eth-token-index = { version = "^0.3.0", optional = true }
|
||||
eth-address-index = { version = "~0.5.0", optional = true }
|
||||
okota = { version = "^0.4.0", optional = true }
|
||||
cic-eth-registry = { version = "^0.6.9", optional = true }
|
||||
cic-contracts = { version = "~0.1.0", optional = true }
|
||||
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
@@ -61,7 +61,6 @@ pytest-cov = "2.10.1"
|
||||
python-semantic-release = "^7.25.2"
|
||||
pylint = "^2.12.2"
|
||||
black = { version = "^22.1.0", allow-prereleases = true }
|
||||
eth-erc20 = ">0.1.2a3,<0.2.0"
|
||||
eth_tester = "0.5.0b3"
|
||||
py-evm = "0.3.0a20"
|
||||
rlp = "2.0.1"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import pytest
|
||||
from cic.contract.csv import load_contract_from_csv
|
||||
|
||||
from tests.base_cic import test_data_dir
|
||||
|
||||
|
||||
def test_csv_generate():
|
||||
@pytest.mark.skip(reason="Public RPC is currently dead")
|
||||
def test_csv_generate_demurrage():
|
||||
outputs_dir = os.path.join(tempfile.mkdtemp(), "outputs")
|
||||
test_csv_path = os.path.join(test_data_dir, "voucher", "bondi.csv")
|
||||
contract = load_contract_from_csv(
|
||||
@@ -72,3 +72,67 @@ def test_csv_generate():
|
||||
assert contract.proof.namespace == "ge"
|
||||
assert contract.proof.proofs == []
|
||||
assert contract.proof.version() == 0
|
||||
|
||||
@pytest.mark.skip(reason="Public RPC is currently dead")
|
||||
def test_csv_generate_giftable():
|
||||
outputs_dir = os.path.join(tempfile.mkdtemp(), "outputs")
|
||||
test_csv_path = os.path.join(test_data_dir, "voucher", "bondi_giftable.csv")
|
||||
contract = load_contract_from_csv(
|
||||
{
|
||||
"WALLET_KEY_FILE": os.path.join(test_data_dir, "keystore", "ok"),
|
||||
"WALLET_PASSPHRASE": "test",
|
||||
"CHAIN_SPEC": "evm:kitabu:6060:sarafu",
|
||||
"RPC_PROVIDER": "http://142.93.38.53:8545",
|
||||
"CIC_REGISTRY_ADDRESS": "0xe3e3431BF25b06166513019Ed7B21598D27d05dC",
|
||||
},
|
||||
outputs_dir,
|
||||
csv_path=test_csv_path,
|
||||
)
|
||||
# assert len(contracts) == 1
|
||||
# contract = contracts[0]
|
||||
# Token
|
||||
assert contract.token.name == "Bondeni"
|
||||
assert contract.token.extra_args == []
|
||||
assert contract.token.extra_args_types == []
|
||||
# assert contract.token.code == os.path.join(test_data_dir, "contracts", "Bondi.bin")
|
||||
assert contract.token.precision == '6'
|
||||
assert contract.token.supply == "5025"
|
||||
assert contract.token.symbol == "BONDE"
|
||||
|
||||
# Meta
|
||||
assert contract.meta.country_code == "KE"
|
||||
assert contract.meta.location == "Mutitu Kilifi"
|
||||
assert contract.meta.contact == {
|
||||
"email": "info@grassecon.org",
|
||||
"phone": "254797782065",
|
||||
}
|
||||
assert contract.meta.name == "Bondeni SHG"
|
||||
|
||||
# Network
|
||||
assert contract.network.resources["eth"]["chain_spec"] == {
|
||||
"arch": "evm",
|
||||
"common_name": "sarafu",
|
||||
"custom": [],
|
||||
"extra": {},
|
||||
"fork": "kitabu",
|
||||
"network_id": 6060,
|
||||
}
|
||||
assert contract.network.resources["eth"]["contents"] == {
|
||||
"address_declarator": {
|
||||
"key_account": "cc4f82f5dacde395e1e0cfc4d62827c8b8b5688c",
|
||||
"reference": "f055e83f713DbFF947e923749Af9802eaffFB5f9",
|
||||
},
|
||||
"token": {
|
||||
"key_account": "cc4f82f5dacde395e1e0cfc4d62827c8b8b5688c",
|
||||
"reference": None,
|
||||
},
|
||||
"token_index": {
|
||||
"key_account": "cc4f82f5dacde395e1e0cfc4d62827c8b8b5688c",
|
||||
"reference": "5A1EB529438D8b3cA943A45a48744f4c73d1f098",
|
||||
},
|
||||
}
|
||||
|
||||
assert contract.proof.description == "1 BONDE = 1 itumbe"
|
||||
assert contract.proof.namespace == "ge"
|
||||
assert contract.proof.proofs == []
|
||||
assert contract.proof.version() == 0
|
||||
|
||||
2
tests/testdata/voucher/bondi_giftable.csv
vendored
Normal file
2
tests/testdata/voucher/bondi_giftable.csv
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
issuer,namespace,voucher_name,symbol,location,country_code,supply,precision,token_type,demurrage,period_minutes,phone_number,email_address,sink_account,description
|
||||
Bondeni SHG,ge,Bondeni,BONDE,Mutitu Kilifi,KE,5025,6,giftable,,,254797782065,info@grassecon.org,0xB8830b647C01433F9492F315ddBFDc35CB3Be6A6,1 BONDE = 1 itumbe
|
||||
|
Reference in New Issue
Block a user