rs-soroban-sdk icon indicating copy to clipboard operation
rs-soroban-sdk copied to clipboard

Track more network resources in tests

Open dmkozh opened this issue 1 year ago • 1 comments

Currently we only allow displaying (and enforcing) budget metering data in the unit tests. We can do better and surface more resources and even optionally enforce these:

  • Ledger reads/writes/RW bytes can be inferred from the storage state. The caveat is that we need to snapshot storage before every contract invocation. Then we can use e2e_invoke env module to get the ledger changes.
  • Events/return value - these can be also extracted from env. The event resets also need to be implemented for this to work properly
  • Rent bumps - we should add a capability to test for entries being bumped, as well as provide a way to examine the overall bump amount using e2e_invoke.
  • Fees - while we can't provide the exact fees, we could try coming up with a ballpark given some sane pre-defined config. This is probably much less useful than the features above, so can be done later.

dmkozh avatar Oct 11 '23 18:10 dmkozh

Part of a larger conversation in Discord regarding this: (link is to a relevant start for this concern) https://discord.com/channels/897514728459468821/1161363751132463234/1161724931231461487

kalepail avatar Oct 11 '23 18:10 kalepail