onflow / cadence-tools

Developer tools for Cadence
https://www.onflow.org/
Apache License 2.0
24 stars 20 forks source link

[test] Enable storage limit for emulator backend #271

Open m-Peter opened 8 months ago

m-Peter commented 8 months ago

Description

This will make the testing environment behave more similar to a development/testnet/mainnet environment.


m-Peter commented 8 months ago

Note: I will rework this to be enabled with a pragma, instead of enabling it by default. That is actually requires quite some changes, and I do not see any benefit. I think it is better to have the storage limit always enabled, as users can easily mint/burn flows, to test out scenarios with storage.

m-Peter commented 7 months ago

The default value is taken from here: https://github.com/onflow/flow-go/blob/47e239c3b505d75b41c3cb92666eba56d541c8a0/fvm/bootstrap.go#L26-L28, when using emulator.WithStorageLimitEnabled(true). We can specify a different value with emulator.WithMinimumStorageReservation(), but this cannot be changed once the emulator is up and running. That's why I went with the default value, to keep parity with the rest of the environments.

m-Peter commented 7 months ago

@SupunS I have reworked this to use a Cadence pragma directive, instead of enabling it by default. Take a look when you can, and let me know what you think :pray: