-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
901 additions
and
1,218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Configs for testing repo download: | ||
SDK_TESTING_URL="https://github.com/algorand/algorand-sdk-testing" | ||
SDK_TESTING_BRANCH="master" | ||
SDK_TESTING_HARNESS="test-harness" | ||
|
||
VERBOSE_HARNESS=0 | ||
|
||
# WARNING: If set to 1, new features will be LOST when downloading the test harness. | ||
# REGARDLESS: modified features are ALWAYS overwritten. | ||
REMOVE_LOCAL_FEATURES=0 | ||
|
||
# WARNING: Be careful when turning on the next variable. | ||
# In that case you'll need to provide all variables expected by `algorand-sdk-testing`'s `.env` | ||
OVERWRITE_TESTING_ENVIRONMENT=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
UNIT_TAGS := "$(subst :, or ,$(shell awk '{print $2}' tests/cucumber/unit.tags | paste -s -d: -))" | ||
INTEGRATIONS_TAGS := "$(subst :, or ,$(shell awk '{print $2}' tests/cucumber/integration.tags | paste -s -d: -))" | ||
|
||
unit: | ||
node_modules/.bin/cucumber-js --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.keyreg or @unit.transactions.payment or @unit.responses.231 or @unit.feetest or @unit.indexer.logs or @unit.abijson or @unit.abijson.byname or @unit.atomic_transaction_composer or @unit.responses.unlimited_assets or @unit.indexer.ledger_refactoring or @unit.algod.ledger_refactoring or @unit.dryrun.trace.application or @unit.sourcemap" tests/cucumber/features --require-module ts-node/register --require tests/cucumber/steps/index.js | ||
node_modules/.bin/cucumber-js --tags $(UNIT_TAGS) tests/cucumber/features --require-module ts-node/register --require tests/cucumber/steps/index.js | ||
|
||
integration: | ||
node_modules/.bin/cucumber-js --tags "@algod or @assets or @auction or @kmd or @send or @indexer or @rekey_v1 or @send.keyregtxn or @dryrun or @compile or @applications or @indexer.applications or @applications.verified or @indexer.231 or @abi or @c2c or @compile.sourcemap" tests/cucumber/features --require-module ts-node/register --require tests/cucumber/steps/index.js | ||
node_modules/.bin/cucumber-js --tags $(INTEGRATIONS_TAGS) tests/cucumber/features --require-module ts-node/register --require tests/cucumber/steps/index.js | ||
|
||
# The following assumes that all cucumber steps are defined in `./tests/cucumber/steps/steps.js` and begin past line 135 of that file. | ||
# Please note any deviations of the above before presuming correctness. | ||
display-all-js-steps: | ||
tail -n +135 tests/cucumber/steps/steps.js | grep -v '^ *//' | awk "/(Given|Then|When)/,/',/" | grep -E "\'.+\'" | sed "s/^[^']*'\([^']*\)'.*/\1/g" | ||
|
||
harness: | ||
./test-harness.sh | ||
|
||
docker-build: | ||
docker build -t js-sdk-testing -f tests/cucumber/docker/Dockerfile $(CURDIR) --build-arg TEST_BROWSER --build-arg CI=true | ||
|
||
docker-run: | ||
docker ps -a | ||
docker run -it --network host js-sdk-testing:latest | ||
|
||
docker-test: | ||
./tests/cucumber/docker/run_docker.sh | ||
docker-test: harness docker-build docker-run | ||
|
||
format: | ||
npm run format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import JSONRequest from '../jsonrequest'; | ||
import HTTPClient from '../../client'; | ||
import IntDecoding from '../../../types/intDecoding'; | ||
|
||
export default class GetTransactionProof extends JSONRequest { | ||
constructor( | ||
c: HTTPClient, | ||
intDecoding: IntDecoding, | ||
private round: number, | ||
private txID: string | ||
) { | ||
super(c, intDecoding); | ||
|
||
this.round = round; | ||
this.txID = txID; | ||
} | ||
|
||
path() { | ||
return `/v2/blocks/${this.round}/transactions/${this.txID}/proof`; | ||
} | ||
|
||
/** | ||
* Exclude assets and application data from results | ||
* The type of hash function used to create the proof, must be one of: "sha512_256", "sha256" | ||
* | ||
* #### Example | ||
* ```typescript | ||
* const hashType = "sha256"; | ||
* const round = 123456; | ||
* const txId = "abc123; | ||
* const txProof = await algodClient.getTransactionProof(round, txId) | ||
* .hashType(hashType) | ||
* .do(); | ||
* ``` | ||
* | ||
* @param hashType | ||
* @category query | ||
*/ | ||
hashType(hashType: string) { | ||
this.query.hashtype = hashType; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import JSONRequest from '../jsonrequest'; | ||
import HTTPClient from '../../client'; | ||
import IntDecoding from '../../../types/intDecoding'; | ||
|
||
export default class LightBlockHeaderProof extends JSONRequest { | ||
constructor(c: HTTPClient, intDecoding: IntDecoding, private round: number) { | ||
super(c, intDecoding); | ||
|
||
this.round = round; | ||
} | ||
|
||
path() { | ||
return `/v2/blocks/${this.round}/lightheader/proof`; | ||
} | ||
} |
Oops, something went wrong.