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: 🎸 Revamp settlements related entities #245

Open
wants to merge 8 commits into
base: alpha
Choose a base branch
from

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

Breaking Changes

Since some of the settlements related entities have been removed and new ones have been added, this will require a full resync

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 2 times, most recently from 236e22f to b6bc40e Compare July 30, 2024 10:20
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
Copy link

sonarcloud bot commented Aug 16, 2024


export const handleAssetCompliancePaused = async (event: SubstrateEvent): Promise<void> => {
const { params, blockId } = extractArgs(event);
const [, rawTicker] = params;

const ticker = serializeTicker(rawTicker);

const asset = await getAsset(ticker);
const asset = await await getAsset(ticker);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const asset = await await getAsset(ticker);
const asset = await getAsset(ticker);

@@ -29,7 +29,7 @@ export const handleAssetComplianceResumed = async (event: SubstrateEvent): Promi

const ticker = serializeTicker(rawTicker);

const asset = await getAsset(ticker);
const asset = await await getAsset(ticker);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const asset = await await getAsset(ticker);
const asset = await getAsset(ticker);

@@ -41,7 +41,7 @@ export const handleNftCollectionCreated = async (event: SubstrateEvent): Promise
const { params, blockId } = extractArgs(event);
const [, rawTicker] = params;
const ticker = serializeTicker(rawTicker);
const asset = await getAsset(ticker);
const asset = await await getAsset(ticker);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const asset = await await getAsset(ticker);
const asset = await getAsset(ticker);

@@ -73,7 +73,7 @@ export const handleNftPortfolioUpdates = async (event: SubstrateEvent): Promise<

const { ticker, ids } = getNftId(rawNftId);

const asset = await getAsset(ticker);
const asset = await await getAsset(ticker);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const asset = await await getAsset(ticker);
const asset = await getAsset(ticker);

import { CallIdEnum, ModuleIdEnum, EventIdEnum } from 'src/types';
import { PolyxTransactionProps } from '../types/models/PolyxTransaction';

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about disabling for the whole file?

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

Successfully merging this pull request may close these issues.

None yet

2 participants