Test: code simplifications - #2481
Conversation
6631565 to
0b09cdf
Compare
| /// Builds a faucet without the [`BasicWallet`] ride-along, so the account exposes only the | ||
| /// faucet interface. | ||
| #[must_use] | ||
| pub fn bare(mut self) -> Self { | ||
| self.bare = true; | ||
| self | ||
| } |
There was a problem hiding this comment.
nit: I think we could use a more descriptive name for this setter, like without_basic_wallet_component (we could also rename the corresponding bare field to with_basic_wallet_component and set it to false here), but feel free to disregard.
| * [BREAKING][rust] `Client::remove_address` and `Store::remove_address` return `bool` instead of `()`, reporting whether the address was tracked. When it wasn't, `Client::remove_address` now leaves the derived note tag in place instead of running its cleanup. | ||
| * [BREAKING][type][rust] Added the `TransactionRequestError::ForeignProcedureInputsTooLong` variant ([#2187](https://github.com/0xMiden/rust-sdk/pull/2187)). | ||
| * [BREAKING][behavior][store] The `output_notes` table gained a nullable `script_root` column referencing `notes_scripts`, and note scripts are fully normalized: an output note's state blob no longer embeds the script, which is stored once in `notes_scripts` and joined back in on read. All tables are now `STRICT`, and the `tags` table stores its rows keyed by a `(tag, source)` primary key (`WITHOUT ROWID`) instead of carrying a separate unique index. This changes the schema fingerprint, so opening a database created before this change fails with `SchemaHashMismatch` and existing stores must be recreated. | ||
| * [BREAKING][removal][test] Loose helper functions in `miden_client::testing::common` are now methods on `TestClient`. `TestClient::keystore()` exposes the client's keystore, so `ClientConfig::into_client` and `into_unsynced_client` return just the `TestClient` instead of a client/keystore pair ([#2477](https://github.com/0xMiden/rust-sdk/issues/2477)). |
There was a problem hiding this comment.
I think we should include the PR link here
| ### Fixes | ||
|
|
||
| * [FIX][test] The integration tests now run against a fee-charging chain. The testing node's genesis charges a fee by default (`MIDEN_VERIFICATION_BASE_FEE`, default `500`), generates the native fee faucet itself so the accounts it deploys can be seeded with that asset, and pre-funds a pool of basic wallets the suite draws from via a new `--funders` argument (`MIDEN_FUNDER_ACCOUNTS_DIR`). Accounts created by the `miden_client::testing::common` helpers are funded and deployed automatically, and `miden_client::testing::fee::deploy_account` does the same for accounts a test builds itself. The AggLayer accounts are consequently always part of genesis (the `AGGLAYER_GENESIS` env var and the `start-node-agglayer` target are gone) and the AggLayer tests load them from `AGGLAYER_ACCOUNTS_DIR` ([#2446](https://github.com/0xMiden/rust-sdk/issues/2446)). | ||
| * [FIX][test] The integration tests now run against a fee-charging chain. The testing node's genesis charges a fee by default (`MIDEN_VERIFICATION_BASE_FEE`, default `500`), generates the native fee faucet itself so the accounts it deploys can be seeded with that asset, and pre-funds a pool of basic wallets the suite draws from via a new `--funders` argument (`MIDEN_FUNDER_ACCOUNTS_DIR`). A path naming no `.mac` file leaves the run without funders, which is all a fee-free genesis needs, since it declares no wallets for the path to hold. Accounts created by the `miden_client::testing::common` helpers are funded and deployed automatically, and `miden_client::testing::fee::deploy_account` does the same for accounts a test builds itself. The AggLayer accounts are consequently always part of genesis (the `AGGLAYER_GENESIS` env var and the `start-node-agglayer` target are gone) and the AggLayer tests load them from `AGGLAYER_ACCOUNTS_DIR` ([#2446](https://github.com/0xMiden/rust-sdk/issues/2446)). |
There was a problem hiding this comment.
nit: should this change be included in a separate entry instead of modifying the existing one?
| pub async fn into_unsynced_client(self) -> Result<TestClient> { | ||
| let fee_funder = self.fee_funder.clone(); | ||
| let (builder, keystore) = self.into_client_builder()?; | ||
| let (builder, _keystore) = self.into_client_builder()?; |
There was a problem hiding this comment.
Do you think we could make into_client_builder() drop the keystore return entirely? It seems it is no longer being used anywhere since now TestClient::keystore() handles it. Same with create_test_client_builder()
There was a problem hiding this comment.
Good suggestion, removed the keystore from the return values in ad8c0e8
| // callback slots on the faucet, which forces `FungibleAsset` keys to carry | ||
| // `AssetCallbackFlag::Enabled`. Tests construct assets via `FungibleAsset::new`, which defaults | ||
| // to `Disabled`, so adding transfer policies makes `mint_and_send` reject the mint with | ||
| // `ERR_FUNGIBLE_MINT_NOTE_ASSET_NOT_FROM_THIS_FAUCET`. |
There was a problem hiding this comment.
I think this deleted comment is still being referenced by tests.rs:4953 : "for the reason described in test_utils/common.rs"
Closes #2477
TestClientstruct added on test: run integration test with fees #2455.