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

algod: Migrate internal uses of v1 algod API to v2 #4684

Merged
merged 37 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
86fd07e
Delete kmd API affinity
algochoi Oct 12, 2022
c7f6cea
Delete affinity in algod
algochoi Oct 12, 2022
d3277ed
Migrate GetPendingTransactions
algochoi Oct 12, 2022
9dca911
Fix response field
algochoi Oct 13, 2022
5c846ba
Migrate Assets and Accounts to V2
algochoi Oct 18, 2022
ff0fb61
Fix linting and change pending transactions by addr
algochoi Oct 18, 2022
ad0606a
Change pending transaction and params/fee for v2 api
algochoi Oct 18, 2022
0e6c5ff
Change v1 block to v2/bookkeeping block response
algochoi Oct 20, 2022
60c2cba
Merge branch 'master' into v2-goal-migration
algochoi Oct 20, 2022
55f1662
Revise transaction parsing in tests
algochoi Oct 21, 2022
af4ae19
Fix asset call to include creatables
algochoi Oct 21, 2022
2ec5fc2
Fix asset field derefs
algochoi Oct 23, 2022
292b4f6
Try reverting goal waitfortxn
algochoi Oct 24, 2022
ca0eda3
Fix transaction encoding again
algochoi Oct 25, 2022
96bf392
Check for empty asset unit names to pass expect tests
algochoi Oct 25, 2022
08f14f1
Convert v1 endpoints to similar v2 endpoints and change tests
algochoi Oct 26, 2022
f69c7d3
Fix note test that was changed for debugging
algochoi Oct 26, 2022
5b0e7a7
Change pingpong tests to V2 api
algochoi Oct 27, 2022
1acdf98
Merge branch 'master' into v2-goal-migration
algochoi Oct 27, 2022
478dbec
Fix algoh mockClient tests
algochoi Oct 27, 2022
3125af5
Change send transaction API from v1 to v2
algochoi Oct 28, 2022
5c36058
Fix some tests regarding send transaction
algochoi Oct 28, 2022
8b212cb
Minor changes on comments and change expect test cases so error messa…
algochoi Oct 28, 2022
8c14f9c
Delete extraneous comments in client test
algochoi Nov 1, 2022
6e5f5bf
Rename PendingTransactionsStruct to PendingTransactions (#25)
michaeldiamant Nov 1, 2022
5ccca0d
use stateproof v2 api on tests
Nov 1, 2022
066d463
Delete extraneous function makeTestBlock inline
algochoi Nov 1, 2022
37a0812
Add blockstats test to check for event details (#26)
algochoi Nov 2, 2022
6af0e28
Merge branch 'v2-goal-migration' of https://github.com/algochoi/go-al…
algochoi Nov 2, 2022
99f2d2c
Change mockclient in algoh to make block with round number
algochoi Nov 2, 2022
bfe1a2f
Update cmd/algoh/blockstats.go
algochoi Nov 2, 2022
e1e2a4b
Add more error formatting for REST responses (#27)
jasonpaulos Nov 3, 2022
bb260ab
Change error messages on tests after client side parsing
algochoi Nov 3, 2022
bb5170f
Merge branch 'v2-goal-migration' of https://github.com/algochoi/go-al…
algochoi Nov 3, 2022
d21a9d6
Change http response message in SPFullPool test
algochoi Nov 3, 2022
5b680e3
Revise error message check
algochoi Nov 3, 2022
52f3b85
Delete old error message
algochoi Nov 3, 2022
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
Change error messages on tests after client side parsing
  • Loading branch information
algochoi committed Nov 3, 2022
commit bb260ab860b380cbb64a62806315f2343a549884
2 changes: 1 addition & 1 deletion daemon/algod/api/client/restClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ type accountInformationParams struct {

// TransactionsByAddr returns all transactions for a PK [addr] in the [first,
// last] rounds range.
// Deprecated: This function is only used in internal tests (stateproofs_test.go, restClient_test.go)
// Deprecated: This function is only used in internal tests (restClient_test.go)
func (client RestClient) TransactionsByAddr(addr string, first, last, max uint64) (response v1.TransactionList, err error) {
err = client.get(&response, fmt.Sprintf("/v1/account/%s/transactions", addr), transactionsByAddrParams{first, last, max})
return
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-go/cli/goal/expect/goalAppAccountAddressTest.exp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ proc goalAppAccountAddress { TEST_ALGO_DIR TEST_DATA_DIR} {
--app-account $ACCOUNT_4_ADDRESS
expect {
timeout { puts timeout; ::AlgorandGoal::Abort "\n Failed to see expected output" }
"*Couldn't broadcast tx with algod: HTTP 400 Bad Request:*TransactionPool.Remember: transaction*invalid Accounts index 4*" {
"*Couldn't broadcast tx with algod: HTTP 400 Bad Request: TransactionPool.Remember: transaction*invalid Accounts index 4*" {
puts "\nError received successfully "
# wait until the eof signal is received
expect {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e-go/cli/goal/expect/statefulTealAppReadTest.exp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ proc statefulTealAppReadTest { TEST_ALGO_DIR TEST_DATA_DIR} {
spawn goal app call --app-id $APP_ID --from $PRIMARY_ACCOUNT_ADDRESS -w $PRIMARY_WALLET_NAME -d $TEST_PRIMARY_NODE_DIR
expect {
timeout { puts timeout; ::AlgorandGoal::Abort "\n Failed to see expected output" }
"Couldn't broadcast tx with algod: HTTP 400 Bad Request:*TransactionPool.Remember: transaction*" {puts "received expected error"; close}
"Couldn't broadcast tx with algod: HTTP 400 Bad Request: TransactionPool.Remember: transaction*" {puts "received expected error"; close}
eof { close; ::AlgorandGoal::Abort "did not receive expected error" }
}

Expand All @@ -83,7 +83,7 @@ proc statefulTealAppReadTest { TEST_ALGO_DIR TEST_DATA_DIR} {
spawn goal app call --app-id $APP_ID --from $PRIMARY_ACCOUNT_ADDRESS -w $PRIMARY_WALLET_NAME --approval-prog-raw ${TEAL_PROGS_DIR}/wrongupgrade.tealc --clear-prog-raw ${TEAL_PROGS_DIR}/wrongupgrade.tealc -d $TEST_PRIMARY_NODE_DIR
expect {
timeout { puts timeout; ::AlgorandGoal::Abort "\n Failed to see expected output" }
"Couldn't broadcast tx with algod: HTTP 400 Bad Request:*TransactionPool.Remember: transaction*" {puts "received expected error"; close}
"Couldn't broadcast tx with algod: HTTP 400 Bad Request: TransactionPool.Remember: transaction*" {puts "received expected error"; close}
eof { close; ::AlgorandGoal::Abort "did not receive expected error" }
}

Expand Down
4 changes: 2 additions & 2 deletions test/e2e-go/cli/goal/expect/statefulTealCreateAppTest.exp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ proc statefulTealTest { TEST_ALGO_DIR TEST_DATA_DIR TEAL_PROGRAM} {
spawn goal app call --app-id $APP_ID --from $PRIMARY_ACCOUNT_ADDRESS -w $PRIMARY_WALLET_NAME -d $TEST_PRIMARY_NODE_DIR
expect {
timeout { puts timeout; ::AlgorandGoal::Abort "\n Failed to see expected output" }
"Couldn't broadcast tx with algod: HTTP 400 Bad Request:*TransactionPool.Remember: transaction*" {puts "received expected error"; close}
"Couldn't broadcast tx with algod: HTTP 400 Bad Request: TransactionPool.Remember: transaction*" {puts "received expected error"; close}
eof { close; ::AlgorandGoal::Abort "did not receive expected error" }
}

Expand All @@ -88,7 +88,7 @@ proc statefulTealTest { TEST_ALGO_DIR TEST_DATA_DIR TEAL_PROGRAM} {
"Please enter the password for wallet '$WALLET_1_NAME':" {send "$WALLET_1_PASSWORD\r" ; exp_continue }
"*not opted in to app*" {puts "received expected error"; close}
"*exceeds schema bytes count*" {puts "received expected error"; close}
"Couldn't broadcast tx with algod: HTTP 400 Bad Request:*TransactionPool.Remember: transaction*" {puts "received expected error"; close}
"Couldn't broadcast tx with algod: HTTP 400 Bad Request: TransactionPool.Remember: transaction*" {puts "received expected error"; close}
eof { close; ::AlgorandGoal::Abort "did not receive expected error" }
}
}
Expand Down
6 changes: 2 additions & 4 deletions test/scripts/e2e_subs/e2e-app-simple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ printf 'int 1' > "${TEMPDIR}/simplev1.teal"

# Fail in creating app with v1 approval program
RES=$(${gcmd} app create --creator ${ACCOUNT} --approval-prog "${TEMPDIR}/simplev1.teal" --clear-prog "${TEMPDIR}/simple.teal" --global-byteslices 0 --global-ints ${GLOBAL_INTS} --local-byteslices 0 --local-ints 0 2>&1 || true)
EXPERROR='program version must be >= 2 for this transaction group'
EXPERRORUNICODE='program version must be \u003e= 2 for this transaction group'
EXPERROR='program version must be >= 2 for this transaction groupd'
if [[ $RES != *"${EXPERROR}"* && $RES != *"${EXPERRORUNICODE}"* ]]; then
date '+app-create-test FAIL should fail to create app with v1 approval program %Y%m%d_%H%M%S'
false
Expand All @@ -33,8 +32,7 @@ fi
# Fail in creating app with v1 clearstate program
RES=$(${gcmd} app create --creator ${ACCOUNT} --approval-prog "${TEMPDIR}/simple.teal" --clear-prog "${TEMPDIR}/simplev1.teal" --global-byteslices 0 --global-ints ${GLOBAL_INTS} --local-byteslices 0 --local-ints 0 2>&1 || true)
EXPERROR='program version must be >= 2 for this transaction group'
EXPERRORUNICODE='program version must be \u003e= 2 for this transaction group'
if [[ $RES != *"${EXPERROR}"* && $RES != *"${EXPERRORUNICODE}"* ]]; then
if [[ $RES != *"${EXPERROR}"* ]]; then
date '+app-create-test FAIL should fail to create app with v1 clearstate program %Y%m%d_%H%M%S'
false
fi
Expand Down
3 changes: 1 addition & 2 deletions test/scripts/e2e_subs/rekey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ cat "${TEMPDIR}/group0_split-0.stxn" "${TEMPDIR}/group0_split-1.txn" > "${TEMPDI
# Broadcast group (should fail)
RES=$(${gcmd} clerk rawsend -f "${TEMPDIR}/group0_signed.stxn" 2>&1 || true)
EXPERROR='program version must be >= 2 for this transaction group'
EXPERRORUNICODE='program version must be \u003e= 2 for this transaction group'
if [[ $RES != *"${EXPERROR}"* && $RES != *"${EXPERRORUNICODE}"* ]]; then
if [[ $RES != *"${EXPERROR}"* ]]; then
date "+${scriptname} FAIL txn group with rekey transaction should require version >= 2 %Y%m%d_%H%M%S"
false
fi
Expand Down