Skip to content

Commit

Permalink
Merge branch 'master' into bvrooman/test/contract_root_bench
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Vrooman authored Oct 25, 2023
2 parents dca8bd6 + df673ea commit 11e977e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test-beta4-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
envsubst < ${{ github.workspace }}/.github/workflows/e2e_config/beta-4.toml.template > ${{ github.workspace }}/.github/workflows/e2e_config/beta-4.toml
- name: Run e2e tests with docker
run: docker run -v ${{ github.workspace }}/.github/workflows/e2e_config:/etc/e2e_config -e FUEL_CORE_E2E_CONFIG='/etc/e2e_config/beta-4.toml' ghcr.io/fuellabs/fuel-core-e2e-client:v0.20.7 ./fuel-core-e2e-client -- alice
run: docker run -v ${{ github.workspace }}/.github/workflows/e2e_config:/etc/e2e_config -e FUEL_CORE_E2E_CONFIG='/etc/e2e_config/beta-4.toml' ghcr.io/fuellabs/fuel-core-e2e-client:sha-ccba276 ./fuel-core-e2e-client -- alice
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
Description of the upcoming release here.

### Added

- [#1449](https://github.com/FuelLabs/fuel-core/pull/1449): fix coin pagination in e2e test client
- [#1447](https://github.com/FuelLabs/fuel-core/pull/1447): Add timeout for continuous e2e tests
- [#1444](https://github.com/FuelLabs/fuel-core/pull/1444): Add "sanity" benchmarks for memory opcodes.
- [#1437](https://github.com/FuelLabs/fuel-core/pull/1437): Add some transaction throughput tests for basic transfers.
Expand Down
15 changes: 11 additions & 4 deletions bin/e2e-test-client/src/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,26 +107,33 @@ impl Wallet {
pub async fn owns_coin(&self, utxo_id: UtxoId) -> anyhow::Result<bool> {
let mut first_page = true;
let mut results = vec![];
let mut cursor = None;

while first_page || !results.is_empty() {
first_page = false;
results = self
let response = self
.client
.coins(
&self.address,
None,
PaginationRequest {
cursor: None,
cursor,
results: 100,
direction: PageDirection::Forward,
},
)
.await?
.results;
.await?;
results = response.results;
// check if page has the utxos we're looking for
if results.iter().any(|coin| coin.utxo_id == utxo_id) {
return Ok(true)
}
// otherwise update the cursor to check the next page
if response.has_next_page {
cursor = response.cursor;
} else {
break
}
}

Ok(false)
Expand Down

0 comments on commit 11e977e

Please sign in to comment.