Test: add RAM-billing and KV API coverage tests#331
Open
heifner wants to merge 2 commits into
Open
Conversation
Cherry-pick of 3579049 adapted to master's kv host API. Adds 38 new kv_api_tests cases and 2 new protocol_feature_tests cases covering payer-change billing, erase refund payer attribution, secondary-index billing, cross-account billing, read-only rejection, payer authorization edge cases, notification billing, mixed-payer transactions, ROA quota enforcement, privileged-sysio bypass, key/value size boundaries, iterator invalidation under mutation, and cross-contract secondary reads. Adaptations vs the abandoned feature/kv-secondary-primary-id base: drop the index_id argument from kv_idx_* calls (master collapsed table+index_id into uint32_t table_id), replace name-literal table ids with uint32_t constants (300-305), rename contract-side key_format -> test_table_id, restore the no-arg kv_billing_tester::get_ram_usage() overload, qualify read_only_rejects_kv_* tests with the kv_api_tester::t reference, and bump the new protocol_feature_tests ROA budgets from 0.0941 to 0.0986 SYS to match master's other tests in this file.
The new RAM-billing actions added in 2612345 grew test_kv_api.wasm enough that the kv_idx_payer_billing test's 1.1000 SYS contract-account budget (1145144 bytes) no longer fits the contract on set_code (needs ~1170000 bytes after the 10x setcode multiplier). Bump to 1.2000 SYS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 38 BOOST_FIXTURE_TEST_CASE entries in
kv_api_testsand 2BOOST_AUTO_TEST_CASE entries (
kv_roa_limit_enforcement,privileged_kv_payer_bypass) inprotocol_feature_testscoveringpayer-change billing, erase refund attribution, secondary-index
billing, cross-account billing, read-only rejection, payer
authorization edge cases, notification billing, mixed-payer
transactions, ROA quota enforcement, privileged-sysio bypass,
key/value size boundaries, iterator invalidation under mutation,
and cross-contract secondary reads.
Test coverage