diff --git a/.changelog/unreleased/testing/694-dont-spawn-internal-account-vps.md b/.changelog/unreleased/testing/694-dont-spawn-internal-account-vps.md new file mode 100644 index 0000000000..664438b982 --- /dev/null +++ b/.changelog/unreleased/testing/694-dont-spawn-internal-account-vps.md @@ -0,0 +1,2 @@ +- Don't fake a wasm VP for internal addresses in tx tests + ([#694](https://github.com/anoma/namada/pull/694)) \ No newline at end of file diff --git a/tests/src/vm_host_env/tx.rs b/tests/src/vm_host_env/tx.rs index 6a3ef96084..3eb674946a 100644 --- a/tests/src/vm_host_env/tx.rs +++ b/tests/src/vm_host_env/tx.rs @@ -111,14 +111,23 @@ impl TestTxEnv { ); } - /// Fake accounts existence by initializating their VP storage. + /// Fake accounts' existence by initializing their VP storage. /// This is needed for accounts that are being modified by a tx test to - /// pass account existence check in `tx_write` function. + /// pass account existence check in `tx_write` function. Only established + /// addresses ([`Address::Established`]) have their VP storage initialized, + /// as other types of accounts should not have wasm VPs in storage in any + /// case. pub fn spawn_accounts( &mut self, addresses: impl IntoIterator>, ) { for address in addresses { + if matches!( + address.borrow(), + Address::Internal(_) | Address::Implicit(_) + ) { + continue; + } let key = Key::validity_predicate(address.borrow()); let vp_code = vec![]; self.storage