Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 7.0 compatible SQ #245

Merged
merged 22 commits into from
Sep 13, 2024
Merged

feat: 🎸 7.0 compatible SQ #245

merged 22 commits into from
Sep 13, 2024

Conversation

prashantasdeveloper
Copy link
Contributor

@prashantasdeveloper prashantasdeveloper commented Jul 9, 2024

Description

  • Entities Settlement, MediatorAffirmation, IdentityInstructions have been removed

  • Changes in Venue entity

    1. New attribute signers has been added to track all the allowed signers associated with them
    2. New derived field instructions: [Instruction]! has been added to track instruction info
      associated a Venue
  • Adds new enum InstructionTypeEnum to track instruction type

  • Changes in Instruction entity

    1. eventId, eventIdx have been removed
    2. settlementType: String! has been modified to type: InstructionTypeEnum!
    3. endAfterBlock: Int has been added to track block after which SettleManual type
      instructions can be executed
    4. mediators: [String!]! has been added to track list of mediators for an instruction
    5. New derived fields namely - parties: [InstructionParty]!,
      affirmations: [InstructionAffirmation]!, events: [InstructionEvent]! have been added to
      query more information about an instruction
  • Changes in Leg entity

    1. Attribute settlement: Settlement has been removed
    2. Attribute instruction is now non-null
    3. The from and to part of the legs have been split separately into identity and
      portfolio number to support off chain legs. The new attributes are
      from: String!, fromPortfolio: number, to: String!, toPortfolio: number
  • Following new entities have been added:

    1. InstructionParty - to track all the DIDs associated with an instruction.
    2. InstructionAffirmation- to track all the affirmations received for an instruction
    3. OffChainReceipt - to track all the receipts used in affirming off chain legs
    4. InstructionEvent - to track all the event associated with an instruction.
      This will give a clear picture about the lifetime of an instruction on how it got created,
      to affirming, to execution
  • New module electionprovidermultiphase has been added to ModuleIdEnum

  • Following new events have been added to EventIdEnum:
    MultiSigAddedAdmin, MultiSigRemovedAdmin, MultiSigRemovedPayingDid,
    MultiSigSignersAuthorized, MultiSigSignersRemoved, MultiSigSignersRequiredChanged,
    ProposalApprovalVote, TickerLinkedToAsset, Chilled, EraPaid, ForceEra, Kicked,
    PayoutStarted, SlashReported, StakersElected, ValidatorPrefsSet, ElectionFailed,
    ElectionFinalized, PhaseTransitioned, Rewarded, Slashed.

  • Following new extrinsics have been added to CallIdEnum:
    add_admin, add_multisig_signers, add_multisig_signers_via_admin, approve,
    approve_join_identity, change_sigs_required_via_admin, create_proposal, join_identity,
    reject, remove_admin_via_admin, remove_multisig_signers_via_admin,
    remove_multisig_signers, remove_payer, remove_payer_via_payer, chill_other,
    force_apply_min_commission, kick, set_min_commission, set_staking_configs,
    register_unique_ticker, pre_approve_asset, exempt_asset_affirmation,
    remove_asset_affirmation_exemption, remove_asset_pre_approval, link_ticker_to_asset_id,
    governance_fallback, set_emergency_election_result, set_minimum_untrusted_score,
    submit, sumbit_unsigned.

  • New handlers have been added to track the following events:
    TickerLinkedToAsset, MultiSigAdminAdded, MultiSigRemovedAdmin,
    MultiSigSignersAuthorized, MultiSigSignersRemoved, ProposalApprovalVote

  • venue is now optional in the Instruction entity.

  • ID of the Asset entity is the new Asset ID generated from chain 7.0.0 chain.
    For older chains, legacy ticker format is used to generate the ID.
    All referencing entities will now be tracking this ID for any given Asset.
    To keep the old reference of ticker, new ticker attributes have been added to some
    entities where assetId was referenced as string

  • ticker attribute of Asset entity is now optional.

  • A new attribute raisingTicker of type string has been added to Sto entity.
    This will track ticker value for the raising Asset associated with an Sto.

  • New attributes raisingAssetId and offeringAssetId of type string have
    been added to the Investment entity to track the asset ID for the
    respective type of assets (raising and offering).

  • ticker: String attritube of the ClaimScope entity has been replaced
    by asset: Asset to have a mapping to asset entity.

  • AssetPendingOwnershipTransfer entity has been removed

  • A new MultiSigAdmin entity has been added to track admins for a multisig.
    This also results in a new derived attribute admins to be added tot MultiSig entity.

  • New Approved status has been added to MultiSigProposalStatusEnum

  • Both creator and creatorAccount fields in MultiSigProposal are now optional.

Breaking Changes

This will require a full resync for all the changes listed above

JIRA Link

DA-1232

Checklist

  • Updated the Readme.md (if required) ?

@prashantasdeveloper prashantasdeveloper force-pushed the feat/settlements-v2 branch 3 times, most recently from cdd60ea to 5169556 Compare July 10, 2024 11:21
@prashantasdeveloper prashantasdeveloper force-pushed the feat/settlements-v2 branch 3 times, most recently from b6bc40e to 8255c13 Compare July 30, 2024 12:46
@prashantasdeveloper prashantasdeveloper marked this pull request as ready for review August 16, 2024 07:02
src/mappings/entities/mapCompliance.ts Outdated Show resolved Hide resolved
src/mappings/entities/mapCompliance.ts Outdated Show resolved Hide resolved
src/mappings/entities/mapNfts.ts Outdated Show resolved Hide resolved
src/mappings/entities/mapNfts.ts Outdated Show resolved Hide resolved
src/utils/events.ts Outdated Show resolved Hide resolved
BREAKING CHANGE: 🧨 Since some of the settlements related entities have been removed and new
ones have been added, this will require a full resync. Following are the breaking changes:
- Entities `Settlement`, `MediatorAffirmation`, `IdentityInstructions` have been removed
- Changes in `Venue` entity
  1. New attribute `signers` has been added to track all the allowed signers associated with them
  2. New derived field `instructions: [Instruction]!` has been added to track instruction info
   associated a Venue
- Adds new enum `InstructionTypeEnum` to track instruction type
- Changes in `Instruction` entity
  1. `eventId`, `eventIdx` have been removed
  2. `settlementType: String!` has been modified to `type: InstructionTypeEnum!`
  3. `endAfterBlock: Int` has been added to track block after which `SettleManual` type
  instructions can be executed
  4. `mediators: [String!]!` has been added to track list of mediators for an instruction
  5. New derived fields namely - `parties: [InstructionParty]!`,
  `affirmations: [InstructionAffirmation]!`, `events: [InstructionEvent]!` have been added to
  query more information about an instruction
- Changes in `Leg` entity
  1. Attribute `settlement: Settlement` has been removed
  2. Attribute `instruction` is now non-null
  3. The `from` and `to` part of the legs have been split separately into identity and
  portfolio number to support off chain legs. The new attributes are
  `from: String!`, `fromPortfolio: number`, `to: String!`, `toPortfolio: number`
- Following new entities have been added:
  1. `InstructionParty` - to track all the DIDs associated with an instruction.
  2. `InstructionAffirmation`- to track all the affirmations received for an instruction
  3. `OffChainReceipt` - to track all the receipts used in affirming off chain legs
  4. `InstructionEvent` - to track all the event associated with an instruction.
  This will give a clear picture about the lifetime of an instruction on how it got created,
   to affirming, to execution
A new attribtue `failureReason` has been added to `Instruction`
entity which stores the error type and details depicting why
the instruction failed.
BREAKING CHANGE: 🧨 Changes to support 7.x chain:
- New module `electionprovidermultiphase` has been added to `ModuleIdEnum`
- Following new events have been added to `EventIdEnum`:
  `MultiSigAddedAdmin`, `MultiSigRemovedAdmin`, `MultiSigRemovedPayingDid`,
  `MultiSigSignersAuthorized`, `MultiSigSignersRemoved`, `MultiSigSignersRequiredChanged`,
  `ProposalApprovalVote`, `TickerLinkedToAsset`, `Chilled`, `EraPaid`, `ForceEra`, `Kicked`,
  `PayoutStarted`, `SlashReported`, `StakersElected`, `ValidatorPrefsSet`, `ElectionFailed`,
  `ElectionFinalized`, `PhaseTransitioned`, `Rewarded`, `Slashed`.
- Following new extrinsics have been added to `CallIdEnum`:
  `add_admin`, `add_multisig_signers`, `add_multisig_signers_via_admin`, `approve`,
  `approve_join_identity`, `change_sigs_required_via_admin`, `create_proposal`, `join_identity`,
  `reject`, `remove_admin_via_admin`, `remove_multisig_signers_via_admin`,
  `remove_multisig_signers`, `remove_payer`, `remove_payer_via_payer`, `chill_other`,
  `force_apply_min_commission`, `kick`, `set_min_commission`, `set_staking_configs`,
  `register_unique_ticker`, `pre_approve_asset`, `exempt_asset_affirmation`,
  `remove_asset_affirmation_exemption`, `remove_asset_pre_approval`, `link_ticker_to_asset_id`,
  `governance_fallback`, `set_emergency_election_result`, `set_minimum_untrusted_score`,
  `submit`, `sumbit_unsigned`.
- New handlers have been added to track the following events:
  `TickerLinkedToAsset`, `MultiSigAdminAdded`, `MultiSigRemovedAdmin`,
  `MultiSigSignersAuthorized`, `MultiSigSignersRemoved`, `ProposalApprovalVote`
- ID of the `Asset` entity is the new Asset ID generated from chain 7.0.0 chain.
  For older chains, legacy ticker format is used to generate the ID.
  All referencing entities will now be tracking this ID for any given Asset.
  To keep the old reference of ticker, new ticker attributes have been added to some
  entities where `assetId` was referenced as `string`
- `ticker` attribute of `Asset` entity is now optional.
BREAKING CHANGE: 🧨 Changes to support ticker fields -
- A new attribute `raisingTicker` of type string has been added to `Sto` entity.
  This will track ticker value for the raising Asset associated with an Sto.
- `ticker: String` attribute of the `ClaimScope` entity has been replaced
  by `asset: Asset` to have a mapping to asset entity.
- `AssetPendingOwnershipTransfer` entity has been removed
BREAKING CHANGE: 🧨 New attributes `raisingAssetId` and `offeringAssetId`
  of type string have been added to the `Investment` entity to track
  the asset ID for the respective type of assets (raising and offering).
BREAKING CHANGE: 🧨 New attribute `assetId` has been added to `Scope`
 json to track the ID of the asset for `Asset` scope type
BREAKING CHANGE: 🧨 Since 7.x chain, Instruction can be created
  without specifying a venue. To support that `venue` attribute
  in `Instruction` entity has been made optional.
BREAKING CHANGE: 🧨 Changes to support multisig with 7.x chain
- A new `MultiSigAdmin` entity has been added to track admins for a multisig.
  This also results in a new derived attribute `admins` to be added tot `MultiSig` entity.
- New `Approved` status has been added to `MultiSigProposalStatusEnum`
- Both `creator` and `creatorAccount` fields in `MultiSigProposal` are now optional.
when a multiSig signer changes their vote, the vote record will now be
updated instead of inserting a second vote. Proposal approval/rejection
counts will now be decremented in this case
@prashantasdeveloper prashantasdeveloper changed the title feat: 🎸 Revamp settlements related entities feat: 🎸 7.0 compatible SQ Sep 12, 2024
Copy link

sonarcloud bot commented Sep 12, 2024

@polymath-eric
Copy link
Contributor

/fast-forward

@polymesh-bot polymesh-bot merged commit 4a7e67f into alpha Sep 13, 2024
9 checks passed
@polymesh-bot polymesh-bot deleted the feat/settlements-v2 branch September 13, 2024 19:03
@polymesh-bot
Copy link
Contributor

🎉 This PR is included in version 16.0.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@polymesh-bot
Copy link
Contributor

🎉 This PR is included in version 16.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants