stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
128 stars 67 forks source link

Add fn for changing an Env's test config #1308

Closed leighmcculloch closed 4 months ago

leighmcculloch commented 4 months ago

What

Add fn for changing an Envs config after creation.

Why

There are ways to create Envs without an opportunity to set a config.

It's cumbersome to offer a way to set the config with all of the different ways, and adding a function for changing it after creation is the simplest way today to achieve this.

This could create problems if in the future the config contains items that aren't easily changeable after instatiation of the Env. That problem doesn't exist today at least. In the future if we introduce items like that we'd probably need to resort to checking if the value is changing, and if so, panicing with a meaningful error message. That's not great, but still better for the overall API I think, especially given this is in tests.

Close #1306

leighmcculloch commented 4 months ago

Released in 21.4.0.