Repository navigation
Conversation
This branch has not been deployed
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.
What
Adds two fetcher interfaces to
@meshsdk/commonfor ledger state thatIFetcherdoes not cover: governance state (DReps, the constitutional committee, the last enacted action of each purpose, the treasury, the constitution) and stake pool registrations.AccountInfoalso gains the account's vote delegation and its registration deposit.Contents
packages/mesh-common/src/interfaces/fetcher.ts:IGovernanceFetcher:fetchDRepState(drepId): a DRep's registration and deposit, by CIP-105 or CIP-129 id. An unknown DRep is reported as not registered.fetchCommitteeState(): the constitutional committee, its sitting members and those proposed to join it.fetchLastEnactedGovernanceActions(): the last enacted action of each governance purpose that has one.fetchTreasury(): the treasury, in lovelace.fetchConstitution(): the constitution in force, with its guardrail script hash.IStakePoolFetcher:fetchPoolState(poolId), a stake pool's registration, by bech32 id or key hash. An unknown pool is reported as not registered.packages/mesh-common/src/types/:governance.ts:DRepState,CommitteeMemberState,EnactedGovernanceAction,ConstitutionState.pool-params.ts:PoolState(registration, deposit, announced retirement epoch, reward address).account-info.ts:AccountInfo.drep: the CIP-129 id of the DRep the stake address delegates its vote to,alwaysAbstainoralwaysNoConfidence;nullwhen it delegates its vote to none; left out when the provider does not report it.AccountInfo.deposit: the registration deposit, when the provider reports it.Types and interfaces only, no runtime code. The new
AccountInfofields are optional, so existing providers and callers are unaffected.Validation
@meshsdk/common: 20 suites, 179 tests pass.