-
Notifications
You must be signed in to change notification settings - Fork 143
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
C2C Feature and Testing #268
Changes from 92 commits
4cab7a8
223b05e
bad480d
3b6f40c
7b732a6
7cf0608
58cef31
43874b2
d3fe73d
c7f4e14
72d172d
e96b740
e052fa7
d55f9a6
a748f7b
982d519
23f63bb
7daa605
f21ec5d
5a6be1c
cfef0a6
d63b4d1
5c9d28e
5e9ab5a
c024249
9fa591a
351099a
c5df38c
8f24033
d664879
34c625c
b29bdaa
1239547
c218fdf
2fbf11a
2503554
eed9935
00f550b
0428abe
ad7a483
59d0a3a
89c7b27
d53ca05
fc69812
e5867a3
56a4717
e43ffd5
a40ad47
cc9383e
5a9c50d
567461f
db7a6f8
7fd692e
a378baa
47f93b0
45d4c2d
13a32e7
360328b
a6f9a8c
3db9d58
5682652
ab4c856
f6450c6
029dc63
7a4c27e
f531044
fe1cd04
67e1e3f
b5e1948
2636698
3147ea8
06fd4fc
2af6fbd
e5245ab
609ee93
bd91048
2f97048
f3bbfe9
78382b9
d1fdd4a
c0e0ade
46d3560
cf5f24e
ec57685
49ed47b
12b7703
415d29a
7bc9dcb
c96c7fc
d4737a5
a0a494f
a72a57b
7350194
595a0cb
e5b5cfb
05f4001
fb7c5c2
c3a96d3
2a96d9e
3089855
1c097e9
cef5808
192c9f9
82dde0b
3eac5ec
e323f0e
d1ea229
41bcdae
df71706
399d2ac
b383a03
7639bcd
e1aa79c
160e47d
be09d1b
886923c
7e16dcb
f040b58
6e65206
f689f1b
0bcdcb8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
UNITS = "@unit.abijson or @unit.algod or @unit.applications or @unit.atomic_transaction_composer or @unit.dryrun or @unit.feetest or @unit.indexer or @unit.indexer.logs or @unit.offline or @unit.rekey or @unit.responses or @unit.responses.231 or @unit.tealsign or @unit.transactions or @unit.transactions.payment" | ||
unit: | ||
behave --tags="@unit.offline or @unit.algod or @unit.indexer or @unit.rekey or @unit.tealsign or @unit.dryrun or @unit.applications or @unit.responses or @unit.transactions or @unit.transactions.payment or @unit.responses.231 or @unit.feetest or @unit.indexer.logs or @unit.abijson or @unit.atomic_transaction_composer" test -f progress2 | ||
behave --tags=$(UNITS) test -f progress2 | ||
|
||
INTEGRATIONS = "@abi or @algod or @applications or @applications.verified or @assets or @auction or @c2c or @compile or @dryrun or @dryrun.testing or @indexer or @indexer.231 or @indexer.applications or @kmd or @rekey or @send" | ||
integration: | ||
behave --tags="@algod or @assets or @auction or @kmd or @send or @template or @indexer or @indexer.applications or @rekey or @compile or @dryrun or @dryrun.testing or @applications or @applications.verified or @indexer.231 or @abi" test -f progress2 | ||
behave --tags=$(INTEGRATIONS) test -f progress2 | ||
|
||
docker-test: | ||
./run_integration.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,11 @@ | |
import base64 | ||
import copy | ||
from enum import IntEnum | ||
from typing import Any, List, TypeVar, Union | ||
from typing import Any, Dict, List, TypeVar, Union | ||
|
||
from algosdk import abi, error | ||
from algosdk.abi.address_type import AddressType | ||
|
||
from algosdk.future import transaction | ||
from algosdk.v2client import algod | ||
|
||
|
@@ -506,6 +507,7 @@ def execute( | |
raw_value=raw_value, | ||
return_value=return_value, | ||
decode_error=decode_error, | ||
tx_info=client.pending_transaction_info(tx_id), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For completenes, making requests to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean even for methods that return void? Because that's what this change does. Also, any functions that might raise errors ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
) | ||
) | ||
continue | ||
|
@@ -543,6 +545,7 @@ def execute( | |
raw_value=raw_value, | ||
return_value=return_value, | ||
decode_error=decode_error, | ||
tx_info=resp, | ||
) | ||
method_results.append(abi_result) | ||
|
||
|
@@ -689,16 +692,18 @@ def __init__( | |
raw_value: bytes, | ||
return_value: Any, | ||
decode_error: error, | ||
tx_info: dict, | ||
) -> None: | ||
self.tx_id = tx_id | ||
self.raw_value = raw_value | ||
self.return_value = return_value | ||
self.decode_error = decode_error | ||
self.tx_info = tx_info | ||
|
||
|
||
class AtomicTransactionResponse: | ||
def __init__( | ||
self, confirmed_round: int, tx_ids: List[str], results: ABIResult | ||
self, confirmed_round: int, tx_ids: List[str], results: List[ABIResult] | ||
) -> None: | ||
self.confirmed_round = confirmed_round | ||
self.tx_ids = tx_ids | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
from urllib.request import Request, urlopen | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I re-org'ed the imports when I touched this file to add functionality to |
||
import base64 | ||
import json | ||
from urllib import parse | ||
import urllib.error | ||
import json | ||
import base64 | ||
from .. import error | ||
from .. import encoding | ||
from .. import constants | ||
from .. import future | ||
import msgpack | ||
from .. import util | ||
from urllib.request import Request, urlopen | ||
|
||
from .. import constants, encoding, error, future, logic, util | ||
|
||
api_version_path_prefix = "/v2" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
. | ||
black==21.9b0 | ||
glom==20.11.0 | ||
tzaffi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
git+https://github.com/behave/behave |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ pushd $rootdir | |
|
||
# Reset test harness | ||
rm -rf test-harness | ||
git clone --single-branch --branch master https://github.com/algorand/algorand-sdk-testing.git test-harness | ||
git clone --single-branch --branch zc2c https://github.com/algorand/algorand-sdk-testing.git test-harness | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to point back to main branch once algorand/algorand-sdk-testing#156 is merged. |
||
|
||
## Copy feature files into the project resources | ||
mkdir -p test/features | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ def encode_bytes(d): | |
encode_bytes(d[i]) | ||
else: | ||
if isinstance(d[i], bytes): | ||
assert False, "Zeph thinks this code is unreachable" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pylance was complaining that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The next line should likely be |
||
d[i] = base64.b64encode(v).decode() | ||
return d | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduce variables for the cucumber test tags, and also alphabetize.
This allows usage such as:
make unit UNITS="@unit.atomic_transaction_composer"