Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stargate #2613

Merged
merged 69 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
048023a
Get balance
MissingNO57 Aug 10, 2021
e4031de
Removed unsafe functions
MissingNO57 Aug 10, 2021
8061e8c
lint fix
MissingNO57 Aug 10, 2021
d3ffd2f
Account query
MissingNO57 Aug 11, 2021
53247bf
Addresses fix
MissingNO57 Aug 11, 2021
51cff2a
Faucet fix
MissingNO57 Aug 11, 2021
fae8cd1
aea config
MissingNO57 Aug 11, 2021
f3977d6
account number and sequence fix
MissingNO57 Aug 11, 2021
6d6964a
tx generation
MissingNO57 Aug 11, 2021
a74f5b6
Txs
MissingNO57 Aug 11, 2021
34d9758
signing
MissingNO57 Aug 11, 2021
5028353
deploy init
MissingNO57 Aug 12, 2021
9d11753
Fix
MissingNO57 Aug 12, 2021
976b16c
fixes
MissingNO57 Aug 12, 2021
5f81a9d
execute
MissingNO57 Aug 12, 2021
2139320
removed unused functions
MissingNO57 Aug 12, 2021
46a2980
More fixed functions
MissingNO57 Aug 12, 2021
85e1ff2
fixes
MissingNO57 Aug 13, 2021
4aaa4b0
Some tests fixed
MissingNO57 Aug 13, 2021
d9c0fc0
FIxed tests
MissingNO57 Aug 13, 2021
529352c
Fixed tests
MissingNO57 Aug 13, 2021
e4fa462
fixed tests
MissingNO57 Aug 13, 2021
b1286b0
fixed tests
MissingNO57 Aug 13, 2021
df46224
Fixed tests
MissingNO57 Aug 13, 2021
96f00e2
Some fixes
MissingNO57 Aug 20, 2021
356b0f3
fixes
MissingNO57 Aug 20, 2021
fd5686f
tests aded
MissingNO57 Aug 20, 2021
8b54b48
arcturus
MissingNO57 Aug 20, 2021
bd4c383
Configs fixed
MissingNO57 Aug 23, 2021
77d3631
Fetchd image fix
MissingNO57 Aug 23, 2021
a4731c0
cosmpy
MissingNO57 Aug 23, 2021
cc4418e
resolved comments
MissingNO57 Aug 23, 2021
c11d0d9
Added dependencies
MissingNO57 Aug 23, 2021
9a51396
Fixes
MissingNO57 Aug 23, 2021
c8a61ae
Pipfile fix
MissingNO57 Aug 23, 2021
d311129
Checks fixes
MissingNO57 Aug 23, 2021
f560d30
Updated cosmpy to 0.1.3
MissingNO57 Aug 24, 2021
083d26d
Updated erc1155 contract to cw0.14
MissingNO57 Aug 24, 2021
6091391
Cosmpy version updated
MissingNO57 Aug 26, 2021
df2bd0a
Hashes update
MissingNO57 Aug 26, 2021
3390c8d
fixes
MissingNO57 Aug 27, 2021
6012504
more fixes
MissingNO57 Aug 27, 2021
17cc3ed
Funding fix
MissingNO57 Aug 27, 2021
0233b05
Test fixes
MissingNO57 Aug 27, 2021
36f2008
More tests fixed
MissingNO57 Aug 27, 2021
27df13e
Added get wealth timeout
MissingNO57 Aug 27, 2021
4c378e0
Improvements
MissingNO57 Aug 31, 2021
d2d49ee
get wealth moved
MissingNO57 Aug 31, 2021
3a67344
Removed rust
MissingNO57 Aug 31, 2021
d0087aa
Pipfile fix
MissingNO57 Aug 31, 2021
9d95d92
address ipfs cli command tests
5A11 Aug 31, 2021
0b508bb
Merge branch 'feature/queries' of https://github.com/fetchai/agents-a…
5A11 Aug 31, 2021
bbbf34f
fix: cleanup docs and fix docs related test
5A11 Aug 31, 2021
d062dab
cleanup: reuse get_wealth_if_needed
5A11 Aug 31, 2021
9988970
feat: update oracle contracts for cosmwasm 14
jrriehl Aug 31, 2021
89c6cbd
chore: update entrypoint lines
jrriehl Aug 31, 2021
e374c0a
chore: uncomment code
jrriehl Aug 31, 2021
6180fea
chore: generate ipfs hashes
jrriehl Aug 31, 2021
c7c46fb
pull latest develop
5A11 Sep 1, 2021
33815a4
hashes
5A11 Sep 1, 2021
c744a76
add ipfs installation to tox
5A11 Sep 1, 2021
fba58e2
Flaky test fix
MissingNO57 Sep 1, 2021
6befa3d
fix: change ports and private key
jrriehl Sep 2, 2021
411a8db
chore: update oracle contract binary
jrriehl Sep 2, 2021
fe921dd
fix: send 1 atestfet and update oracle client contract binary
jrriehl Sep 3, 2021
c8904db
chore: lint and hashes
jrriehl Sep 3, 2021
4fa28ea
Merge pull request #2609 from fetchai/fix/oracle-update
5A11 Sep 3, 2021
16d975d
fix: oracle handler test failure
5A11 Sep 3, 2021
3ded31f
Merge pull request #2593 from fetchai/feature/queries
5A11 Sep 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified packages/fetchai/contracts/oracle/build/oracle.wasm
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/fetchai/skills/simple_oracle/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _request_init_transaction(self, ledger_id: str, tx_receipt: JSONLike) -> Non
"label": "OracleContract",
"init_msg": {"fee": str(strategy.initial_fee_deploy)},
"gas": strategy.default_gas_deploy,
"amount": 0,
"amount": 1,
"code_id": code_id,
"deployer_address": self.context.agent_address,
}
Expand Down
2 changes: 1 addition & 1 deletion packages/fetchai/skills/simple_oracle/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fingerprint:
__init__.py: QmcaiWWqt2VYwRtXPLmFCHshyHnow3sNeRCa5UmvutUKXp
behaviours.py: QmRQT3Qjx78DXh2QAFkr3ehRk82mvD1a7hdXdx9PmLAEBq
dialogues.py: QmRdwAgCaR6ju5Tk8SW2AzT62JHDMzyA27DEr7a5F7i64Q
handlers.py: QmdXwwBjnndpb35KR3KmXajsoHffaJ7az7QLvgAjNqxLn9
handlers.py: QmaGUDZCqGePMwBoqPT2jz3va3gYoJr3AdL1mnGs25mZ64
strategy.py: QmXGBw4BatnPMxBRhFnG5K3NRQuhq5ZzpZxtAciCfC8dXa
fingerprint_ignore_patterns: []
contracts:
Expand Down
6 changes: 3 additions & 3 deletions packages/hashes.csv
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ fetchai/connections/webhook,QmUrHTvYbpQ6dLSVBD3giS7h9DQNHYXJt4DoToA5VRpWYb
fetchai/connections/yoti,QmNoE34qJe2qP5skBBqZpLcJ8nsJrrfSD9T29uguQnbUrF
fetchai/contracts/erc1155,Qma32tAZxQEzNKosYq3LLQ6qUTHxhzv7BY7NLfRiJQ1LBJ
fetchai/contracts/fet_erc20,QmZbeGvYWGr2J38CK8JS4hcriz3teYVhT1KRBRJ2S9qRfZ
fetchai/contracts/oracle,QmTYM5KBLvAXeELUX68DM43TgbRToRszx7nTDVPeLJh4mC
fetchai/contracts/oracle_client,QmW6zUrR2Ec1ZM57ZBTdekwJddPcd4S66hEz24i7GNT2TD
fetchai/contracts/oracle,QmS1nFvLETGHDsoGT7NaT1ST9BzjwsK46uLkKoFuh3z17p
fetchai/contracts/oracle_client,QmSqVhEsrn3Pu4btWuZJvHbAG71dsY62gu4gknCb4ACKQ3
fetchai/contracts/scaffold,QmVpHToPRYPjBbjQd3fArdb1SWHqiQAvDnLickULehsNRL
fetchai/contracts/staking_erc20,QmVJZpvNmgVYWmD11Br8uytKVvYNSm6zHyrHdBNvK5Ag7s
fetchai/protocols/acn,QmNw5HKLVizqouTiTRAzT9htFGKjJHKH6Q4QRaJXHfyMA1
Expand Down Expand Up @@ -102,7 +102,7 @@ fetchai/skills/scaffold,QmUiNp6kSteawmGixMPDCxcEZmkpnAdw3osKSvu9xFR4VG
fetchai/skills/simple_aggregation,QmWewBQBbCX2zwKPztnz3Epqj6NJ53TjdtKogfqoRT1AxY
fetchai/skills/simple_buyer,QmPAVhTzgUwvMBYZvxKbHpKs7chKv6BUEaWSMCTLVAD8ia
fetchai/skills/simple_data_request,QmR98BHVMmCT8edCtQrhYaKFiGezY4zWUS6pEFtARJdSCQ
fetchai/skills/simple_oracle,QmaRQPkSuxKxPbt3HtkPjVWW4MZXZ9KgQ5mYhcYvbbHvHD
fetchai/skills/simple_oracle,QmVsTiieuvm7KvWVVFrUykytCtVUCnRUebrsV3cGqWbGQJ
fetchai/skills/simple_oracle_client,QmRGdTzujN65r3n8DpHEFNLpLQEB9DRQR4jjXWmNnyCQqG
fetchai/skills/simple_seller,QmUtp19VvwMdsPwun7Ryzh1jvTKNXBBrhLQNa4cGHAZzAu
fetchai/skills/simple_service_registration,QmSrpzpJyRGc9gwtSu1ije6V4KmjheujfWt1Y19Am1mNRo
Expand Down
38 changes: 25 additions & 13 deletions tests/common/docker_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ def wait(self, max_attempts: int = 15, sleep_rate: float = 1.0) -> bool:
class FetchLedgerDockerImage(DockerImage):
"""Wrapper to Fetch ledger Docker image."""

PORTS = {1317: 1317, 26657: 26657}

def __init__(
self,
client: DockerClient,
Expand Down Expand Up @@ -453,20 +455,29 @@ def tag(self) -> str:

def _make_entrypoint_file(self, tmpdirname) -> None:
"""Make a temporary entrypoint file to setup and run the test ledger node"""
run_node_lines = [
run_node_lines = (
"#!/usr/bin/env bash",
"set -e",
f'fetchd init {self._config["moniker"]} --chain-id {self._config["chain_id"]}',
# variables
f'export VALIDATOR_KEY_NAME={self._config["genesis_account"]}',
f'export VALIDATOR_MNEMONIC="{self._config["mnemonic"]}"',
'export PASSWORD="12345678"',
f'export CHAIN_ID={self._config["chain_id"]}',
f'export MONIKER={self._config["moniker"]}',
f'export DENOM={self._config["denom"]}',
# Add key
'( echo "$VALIDATOR_MNEMONIC"; echo "$PASSWORD"; echo "$PASSWORD"; ) |fetchd keys add $VALIDATOR_KEY_NAME --recover',
# Configure node
"fetchd init --chain-id=$CHAIN_ID $MONIKER",
'echo "$PASSWORD" |fetchd add-genesis-account $(fetchd keys show $VALIDATOR_KEY_NAME -a) 100000000000000000000000$DENOM',
'echo "$PASSWORD" |fetchd gentx $VALIDATOR_KEY_NAME 10000000000000000000000$DENOM --chain-id $CHAIN_ID',
"fetchd collect-gentxs",
# Enable rest-api
'sed -i "s/stake/atestfet/" ~/.fetchd/config/genesis.json',
'sed -i "s/enable = false/enable = true/" ~/.fetchd/config/app.toml',
f'MNEMONIC="{self._config["mnemonic"]}"',
"fetchd config keyring-backend test",
f'echo $MNEMONIC | fetchd keys add {self._config["genesis_account"]} --recover',
f'fetchd add-genesis-account $(fetchd keys show {self._config["genesis_account"]} -a) 1152997575000000000000000000{self._config["denom"]}',
f'fetchd gentx --amount 100000000000000000000{self._config["denom"]} --name {self._config["genesis_account"]} --keyring-backend test --chain-id {self._config["chain_id"]}',
"fetchd collect-gentxs",
f"fetchd start --rpc.laddr tcp://0.0.0.0:{self._port}",
]
'sed -i "s/swagger = false/swagger = true/" ~/.fetchd/config/app.toml',
"fetchd start",
)

entrypoint_file = os.path.join(tmpdirname, "run-node.sh")
with open(entrypoint_file, "w") as file:
file.writelines(line + "\n" for line in run_node_lines)
Expand All @@ -485,15 +496,16 @@ def create(self) -> Container:
network="host",
volumes=volumes,
entrypoint=str(entrypoint),
ports=self.PORTS,
)
return container

def wait(self, max_attempts: int = 15, sleep_rate: float = 1.0) -> bool:
"""Wait until the image is up."""
request = dict(jsonrpc=2.0, method="web3_clientVersion", params=[], id=1)
for i in range(max_attempts):
try:
response = requests.post(f"{self._addr}:{self._port}", json=request)
url = f"{self._addr}:{self._port}/net_info?"
response = requests.get(url)
enforce(response.status_code == 200, "")
return True
except Exception:
Expand Down
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
# URL to local Fetch ledger instance
DEFAULT_FETCH_DOCKER_IMAGE_TAG = "fetchai/fetchd:0.8.4"
DEFAULT_FETCH_LEDGER_ADDR = "http://127.0.0.1"
DEFAULT_FETCH_LEDGER_RPC_PORT = 9090
DEFAULT_FETCH_LEDGER_RPC_PORT = 26657
DEFAULT_FETCH_LEDGER_REST_PORT = 1317
DEFAULT_FETCH_ADDR_REMOTE = "https://rest-stargateworld.fetch.ai:443"
DEFAULT_FETCH_MNEMONIC = "gap bomb bulk border original scare assault pelican resemble found laptop skin gesture height inflict clinic reject giggle hurdle bubble soldier hurt moon hint"
Expand Down Expand Up @@ -214,7 +214,7 @@
"b6ef49c3078f300efe2d4480e179362bd39f20cbb2087e970c8f345473661aa5"
)
FUNDED_FETCHAI_PRIVATE_KEY_1 = (
"f848e125edb124d7752338fdd15825cd031b8c7f38627ec50ccccb7d75ecffdb"
"bbaef7511f275dc15f47436d14d6d3c92d4d01befea073d23d0c2750a46f6cb3"
)
FUNDED_FETCHAI_PRIVATE_KEY_2 = (
"9d6459d1f93dd153335291af940f6b5224a34a9a1e1062e2158a45fa4901ed3f"
Expand All @@ -227,7 +227,7 @@
ETHEREUM_ADDRESS_TWO = "0x7A1236d5195e31f1F573AD618b2b6FEFC85C5Ce6"
FETCHAI_ADDRESS_ONE = "fetch1paqxtqnfh7da7z9c05l3y3lahe8rhd0nm0jk98"
FETCHAI_ADDRESS_TWO = "fetch19j4dc3e6fgle98pj06l5ehhj6zdejcddx7teac"
FUNDED_FETCHAI_ADDRESS_ONE = "fetch1dm72s3yravky6t7rp3daajwwsz2vrqd86g2v47"
FUNDED_FETCHAI_ADDRESS_ONE = "fetch1k9dns2fd74644g0q9mfpsmfeqg0h2ym2cm6wdh"
FUNDED_FETCHAI_ADDRESS_TWO = "fetch1x2vfp8ec2yk8nnlzn52agflpmpwtucm6yj2hw4"

# P2P addresses
Expand Down Expand Up @@ -1424,11 +1424,11 @@ def fund_accounts_from_local_validator(
)
pk = PrivateKey(bytes.fromhex(FUNDED_FETCHAI_PRIVATE_KEY_1))

time.sleep(FETCHD_INITIAL_TX_SLEEP)
client = SigningCosmWasmClient(pk, rest_client, DEFAULT_FETCH_CHAIN_ID)
coins = [Coin(amount=str(amount), denom=denom)]

for address in addresses:
time.sleep(FETCHD_INITIAL_TX_SLEEP)
client.send_tokens(CosmpyAddress(address), coins)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ def test_oracle(
f"{DEFAULT_FETCH_LEDGER_ADDR}:{DEFAULT_FETCH_LEDGER_REST_PORT}",
)

# use alternate port for prometheus connection
setting_path = "vendor.fetchai.connections.prometheus.config.port"
self.set_config(setting_path, 9091, type_="int")

setting_path = "vendor.fetchai.skills.simple_oracle.models.strategy.args.contract_address_file"
self.set_config(setting_path, ORACLE_CONTRACT_ADDRESS_FILE)

Expand Down