added single-source MAINNET_NETWORK_ID - #708
Merged
Merged
Conversation
) Share MAINNET_NETWORK_ID and require_not_mainnet via gmx_keys to keep a single source of truth for the test-only mainnet guard (issue SO4-Markets#400). test_token and test_faucet now import the constant and call gmx_keys::require_not_mainnet instead of defining byte-identical copies.
…ure (SO4-Markets#576) adl_handler::MissingMaxPnlConfig was never raised — is_adl_required returns false when max_pnl_factor == 0 (ADL disabled per market_utils docs) instead of erroring, contradicting the variant's own doc comment. Remove the dead variant and keep the silent-disable behaviour as the documented one. oracle::InvalidSignature was never raised — ed25519_verify is a host function that panics with a generic host error on bad signature and has no try_ helper in soroban-sdk 25 to map it to a contract error. Remove the dead variant and document the host-level panic behaviour.
…ates (SO4-Markets#563) Port market_token's allowance-expiration tests (allowance reads zero after expiry, transfer_from/burn_from revert with AllowanceExpired, approve_and_* flows) plus transfer_owner, pause/unpause owner-only gates, and negative-amount rejections for transfer/approve/mint/burn. Closes the coverage gap where test_token — used as collateral token across many downstream handler tests — had only ~6 tests vs market_token's 17.
…O4-Markets#564) Grant-side bookkeeping was covered but revoke-side was not. Add tests that grant 2-3 members, revoke one, and assert get_role_member_count decremented by one and get_role_members no longer contains the revoked account (including removing the middle entry, not just tail). Add idempotent-revoke test mirroring test_idempotent_grant, and a combined AccountRoles/RoleMembers revoke consistency check.
|
@therealjhay Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #567 libs/keys/src/lib.rs:13 — added single-source MAINNET_NETWORK_ID constant and is_mainnet / require_not_mainnet(env, error_code) helpers; contracts/test_token/src/lib.rs:1 and contracts/test_faucet/src/lib.rs:1 now import gmx_keys::MAINNET_NETWORK_ID and call gmx_keys::require_not_mainnet(&env, Error::MainnetNotAllowed as u32) instead of defining byte-identical copies. Cargo.toml:12 for both test contracts now depends on gmx-keys. Verification: grep MAINNET_NETWORK_ID in contracts shows no local definition, only the shared import.
Closes #576 contracts/adl_handler/src/lib.rs:37 — removed dead Error::MissingMaxPnlConfig =8 (ADL disabled is documented as return false when max_pnl_factor==0 in libs/market_utils/src/lib.rs:192); contracts/oracle/src/lib.rs:35 — removed dead Error::InvalidSignature =7 and documented that env.crypto().ed25519_verify panics host-level with no try_ helper in soroban-sdk 25.3.1 src/crypto.rs:45.
Closes #563 contracts/test_token/src/lib.rs:462 — ported market_token allowance-expiration coverage: allowance_reads_zero_after_expiration_ledger_passes, test_approve_and_transfer_from, transfer_from_after_expiration_reverts_with_allowance_expired, test_approve_and_burn_from, burn_from_after_expiration_reverts_with_allowance_expired, plus transfer_owner / non_owner_cannot_* / pause gate tests and 6 negative-amount rejection tests (transfer/approve/mint/burn/transfer_from/burn_from).
Closes #564 contracts/role_store/src/lib.rs:540 — added revoke-side bookkeeping tests: test_revoke_decrements_count_and_removes_member, test_revoke_one_of_many_leaves_others (removes middle entry to exercise vec_remove_addr), test_idempotent_revoke (double revoke no-op, count stays 0), and test_revoke_updates_account_roles_and_member_list_together.