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 1 commit
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
Prev Previous commit
Next Next commit
fixes
  • Loading branch information
MissingNO57 committed Aug 13, 2021
commit 85e1ff22dd28ed57a2c46a678bf702a8692cab7b
9 changes: 5 additions & 4 deletions plugins/aea-ledger-cosmos/aea_ledger_cosmos/cosmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,18 +478,19 @@ def load_private_key_from_path(
) from e
return signing_key

def sign_message(self, message: bytes, is_deprecated_mode: bool = False) -> bytes:
def sign_message(self, message: bytes, is_deprecated_mode: bool = False) -> str:
"""
Sign a message in bytes string form.

:param message: the message to be signed
:param is_deprecated_mode: if the deprecated signing is used
:return: signature of the message in bytes form
:return: signature of the message in string form
"""
signature_compact = self.entity.sign_deterministic(
message, hashfunc=hashlib.sha256, sigencode=sigencode_string_canonize,
)
return signature_compact
signature_base64_str = base64.b64encode(signature_compact).decode("utf-8")
return signature_base64_str

def sign_transaction(self, transaction: JSONLike) -> JSONLike:
"""
Expand Down Expand Up @@ -529,7 +530,7 @@ def sign_transaction(self, transaction: JSONLike) -> JSONLike:
data_for_signing = sd.SerializeToString()

# Generating signature:
signature = self.sign_message(data_for_signing)
signature = base64.b64decode(self.sign_message(data_for_signing))

tx.signatures.extend([signature])

Expand Down
9 changes: 5 additions & 4 deletions plugins/aea-ledger-fetchai/aea_ledger_fetchai/_cosmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,18 +478,19 @@ def load_private_key_from_path(
) from e
return signing_key

def sign_message(self, message: bytes, is_deprecated_mode: bool = False) -> bytes:
def sign_message(self, message: bytes, is_deprecated_mode: bool = False) -> str:
"""
Sign a message in bytes string form.

:param message: the message to be signed
:param is_deprecated_mode: if the deprecated signing is used
:return: signature of the message in bytes form
:return: signature of the message in string form
"""
signature_compact = self.entity.sign_deterministic(
message, hashfunc=hashlib.sha256, sigencode=sigencode_string_canonize,
)
return signature_compact
signature_base64_str = base64.b64encode(signature_compact).decode("utf-8")
return signature_base64_str

def sign_transaction(self, transaction: JSONLike) -> JSONLike:
"""
Expand Down Expand Up @@ -529,7 +530,7 @@ def sign_transaction(self, transaction: JSONLike) -> JSONLike:
data_for_signing = sd.SerializeToString()

# Generating signature:
signature = self.sign_message(data_for_signing)
signature = base64.b64decode(self.sign_message(data_for_signing))

tx.signatures.extend([signature])

Expand Down
53 changes: 17 additions & 36 deletions plugins/aea-ledger-fetchai/tests/test_fetchai.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,12 +713,12 @@ def test_load_contract_interface():

@pytest.mark.integration
@pytest.mark.ledger
def test_construct_transfer_transaction_both_versions():
"""Test the construction of a transfer transaction for both versions."""
def test_construct_init_transaction():
"""Test the construction of a contract onot transaction"""
account = FetchAICrypto()
fetchai_api = FetchAIApi(**FETCHAI_TESTNET_CONFIG)

transfer_transaction = fetchai_api._get_init_transaction(
init_transaction = fetchai_api._get_init_transaction(
deployer_address=account.address,
denom="atestfet",
chain_id="cosmoshub-3",
Expand All @@ -730,35 +730,26 @@ def test_construct_transfer_transaction_both_versions():
label="something",
)
assert (
isinstance(transfer_transaction, dict) and len(transfer_transaction) == 6
isinstance(init_transaction, dict) and len(init_transaction) == 2
), "Incorrect transfer_transaction constructed."
assert len(transfer_transaction["msgs"][0]["value"]["init_funds"]) == 1
fetchai_api.cosmwasm_version = ">=0.10"
transfer_transaction = fetchai_api._get_init_transaction(
deployer_address=account.address,
denom="atestfet",
chain_id="cosmoshub-3",
account_number=1,
sequence=1,
amount=0,
code_id=200,
init_msg={},
label="something",
)
assert (
isinstance(transfer_transaction, dict) and len(transfer_transaction) == 6
), "Incorrect transfer_transaction constructed."
assert len(transfer_transaction["msgs"][0]["value"]["init_funds"]) == 0
init_transaction["tx"]["body"]["messages"][0]["@type"]
== "/cosmwasm.wasm.v1beta1.MsgInstantiateContract"
)


@pytest.mark.integration
@pytest.mark.ledger
def test_construct_handle_transaction_both_versions():
"""Test the construction of a handle transaction for both versions."""
def test_construct_handle_transaction():
"""Test the construction of a transfer transaction."""
account = FetchAICrypto()
account2 = FetchAICrypto()
fetchai_api = FetchAIApi(**FETCHAI_TESTNET_CONFIG)

# Get wealth in order to get account_number
faucet = FetchAIFaucetApi(poll_interval=0)
faucet.get_wealth(account.address)

transaction = fetchai_api.get_handle_transaction(
sender_address=account.address,
contract_address=account2.address,
Expand All @@ -768,22 +759,12 @@ def test_construct_handle_transaction_both_versions():
denom="atestfet",
)
assert (
isinstance(transaction, dict) and len(transaction) == 6
isinstance(transaction, dict) and len(transaction) == 2
), "Incorrect transfer_transaction constructed."
assert len(transaction["msgs"][0]["value"]["sent_funds"]) == 1
fetchai_api.cosmwasm_version = ">=0.10"
transaction = fetchai_api.get_handle_transaction(
sender_address=account.address,
contract_address=account2.address,
handle_msg={},
amount=0,
tx_fee=100,
denom="atestfet",
)
assert (
isinstance(transaction, dict) and len(transaction) == 6
), "Incorrect transfer_transaction constructed."
assert len(transaction["msgs"][0]["value"]["sent_funds"]) == 0
transaction["tx"]["body"]["messages"][0]["@type"]
== "/cosmwasm.wasm.v1beta1.MsgExecuteContract"
)


def test_load_errors():
Expand Down