diff --git a/.github/workflows/e2e-test-beta4-dev.yml b/.github/workflows/e2e-test-beta4-dev.yml index 41687565d9c..0128b8d9a3b 100644 --- a/.github/workflows/e2e-test-beta4-dev.yml +++ b/.github/workflows/e2e-test-beta4-dev.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index d96dfb83c56..e437d999d47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/bin/e2e-test-client/src/test_context.rs b/bin/e2e-test-client/src/test_context.rs index a824111571e..b5f555ad6e5 100644 --- a/bin/e2e-test-client/src/test_context.rs +++ b/bin/e2e-test-client/src/test_context.rs @@ -107,26 +107,33 @@ impl Wallet { pub async fn owns_coin(&self, utxo_id: UtxoId) -> anyhow::Result { 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)