Repository navigation
feat: HF14 prediction-market operations (op ids 60-105) - #4
Merged
Merged
Conversation
- ops 60-65 (fixed_award, target_account_sale, bid, outbid, set_reward_sharing, stakeholder_reward) and 105 (set_agent_permission) - 23 HF14 prediction-market broadcast ops (66-83, 91-93, 98-99) - 16 HF14 prediction-market virtual ops, decode-only - route prediction_market_api read methods in Client - fixtures byte-verified against viz-python-lib / viz-php-lib vectors
The node's pm_leverage_open_operation declares int16_t outcome_index = 0 (leverage is binary-only); -1 is the pm_place_bet/pm_reveal_bet default and was over-generalized. Also bump README install snippet to 0.2.0.
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.
Summary
OperationIdstopped at 59 while the node is at 105. This PR closes the gap, with the HF14 "Onix" prediction-market protocol as the main payload.FixedAward(60),TargetAccountSale(61),Bid(62, virtual),Outbid(63, virtual),SetRewardSharing(64),StakeholderReward(65, virtual),SetAgentPermission(105).PmOracleRegister,PmOracleUpdate,PmCreateMarket,PmPlaceBet,PmCommitBet,PmRevealBet, …,PmLeverageOpen/Close/Convert,PmDisputeOracleRespond,PmUnban. Encodable + decodable, memberwise inits with node defaults (side = -1,outcomeIndex = -1,allowInstantBet = true,endogeneityTier = 2, …).isVirtual == true.PmOracleUpdatecarries real optionals and gets an explicitbinaryEncode(synthesizedencodeIfPresentdrops the flag byte).Client:prediction_market_apiread methods (get_market,list_markets,get_account_positions, …) are routed to their namespace.No encoder changes:
VIZEncoderalready coversInt8/Int16/…/Date/Data/Optional/Array.Verification
AnyOperationdecode). The 23 PM vectors are byte-identical to the ones inviz-python-lib/tests/test_pm_operations.py(shared with viz-php-lib and the node); the 4 gap-op vectors were produced with the viz-js-lib-oracle-verified@viz-cx/coreserializer.stakeholder_reward,pm_payout,pm_leverage_resolve,pm_lp_payout).XCTestManifests.swift.swift test --filter UnitTests: 155 tests, 0 failures.Protocol reference:
viz-cpp-node/libraries/protocol/include/graphene/protocol/{pm_operations,pm_virtual_operations,agent_operations}.hpp.Out of scope:
chain_properties_pm(the library has no chain-properties structs at all today) and typed wrappers for the PM read API.