Skip to content

Commit

Permalink
Merge branch 'main' into fix/troubleshooting-emulator-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman authored Jul 31, 2024
2 parents 01b0096 + 708336c commit de898f6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rpc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-22.04
services:
rpc:
image: stellar/quickstart:v423-testing
image: stellar/quickstart:v438-testing
ports:
- 8000:8000
env:
Expand Down
6 changes: 5 additions & 1 deletion cmd/crates/soroban-test/tests/it/integration/fund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ async fn fund() {
.arg("fund")
.arg("test")
.assert()
.stderr(predicates::str::contains("funding failed"));
// Don't expect error if friendbot indicated that the account is
// already fully funded to the starting balance, because the
// user's goal is to get funded, and the account is funded
// so it is success much the same.
.success();
}
13 changes: 11 additions & 2 deletions cmd/soroban-cli/src/config/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,18 @@ impl Network {
tracing::debug!("{res:#?}");
if !request_successful {
if let Some(detail) = res.get("detail").and_then(Value::as_str) {
return Err(Error::FundingFailed(detail.to_string()));
if detail.contains("account already funded to starting balance") {
// Don't error if friendbot indicated that the account is
// already fully funded to the starting balance, because the
// user's goal is to get funded, and the account is funded
// so it is success much the same.
tracing::debug!("already funded error ignored because account is funded");
} else {
return Err(Error::FundingFailed(detail.to_string()));
}
} else {
return Err(Error::FundingFailed("unknown cause".to_string()));
}
return Err(Error::FundingFailed("unknown cause".to_string()));
}
Ok(())
}
Expand Down

0 comments on commit de898f6

Please sign in to comment.