[test] Enable storage limit for emulator backend#271
[test] Enable storage limit for emulator backend#271m-Peter wants to merge 3 commits intoonflow:masterfrom
Conversation
This will make the testing environment behave more similar to a development/testnet/mainnet environment.
14f69ba to
1c6bc19
Compare
|
|
SupunS
left a comment
There was a problem hiding this comment.
Is there a way to set the storage limit for tests? Or does it use a default value always?
|
The default value is taken from here: https://github.com/onflow/flow-go/blob/47e239c3b505d75b41c3cb92666eba56d541c8a0/fvm/bootstrap.go#L26-L28, when using |
test/test_framework_test.go
Outdated
There was a problem hiding this comment.
I feel these small value differences in account balances could be annoying for users when writing tests.
(Also not sure why it changes the account balances when the storage limit is enabled).
So maybe we should have this disabled by default (to make the simple use-cases simple), and allow developers to enable it only if they need it.
There was a problem hiding this comment.
I feel these small value differences in account balances could be annoying for users when writing tests.
That' a good point 👍
(Also not sure why it changes the account balances when the storage limit is enabled).
The emulator.WithStorageLimitEnabled(true) means that every account has to be created with the minimum storage reservation (0.001 FLOW), otherwise the account would break the storage limit constraint.
So maybe we should have this disabled by default (to make the simple use-cases simple), and allow developers to enable it only if they need it.
Sounds good, I will try the approach where this is enabled per test file, with a pragma directive (#storageLimitEnabled).
|
@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 🙏 |
Description
This will make the testing environment behave more similar to a development/testnet/mainnet environment.
masterbranchFiles changedin the Github PR explorer