Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Update BaseInteroperableMethod and define crossChainMethodContext #7719

Closed
Tracked by #7211
ishantiw opened this issue Nov 1, 2022 · 0 comments
Closed
Tracked by #7211

Update BaseInteroperableMethod and define crossChainMethodContext #7719

ishantiw opened this issue Nov 1, 2022 · 0 comments
Assignees
Labels
framework/module/interoperability Interoperability module
Milestone

Comments

@ishantiw
Copy link
Contributor

ishantiw commented Nov 1, 2022

Description

Update BaseInteroperableMethod to have following methods and other methods should be removed.

  • verifyCrossChainMessage(context: crossChainMethodContext): Promise<void>
  • beforeCrossChainMessageForwarding(context: crossChainMethodContext): Promise<void>
  • beforeCrossChainCommandExecution(context: crossChainMethodContext): Promise<void>
  • afterCrossChainCommandExecution(context: crossChainMethodContext): Promise<void>

Define crossChainMethodContext that will be passed on to each hook

export interface crossChainMethodContext {
    getMethodContext: () => MethodContext;
    getStore: StoreCallback;
    logger: Logger;
    eventQueue: EventQueue;
    chainID: Buffer;
    transaction: Partial<Transaction>{ fee: bigint, senderAddress: Buffer };
    header: Partial<BlockHeader>{ height: number }
    ccm: CCMsg;
}
  • Remove all the old crossChainMethods from BaseInteroperableMethod and related interfaces
  • Remove all context create functions from interoperability/context.ts and add function to create crossChainContext

Acceptance Criteria

  • Should have all interfaces and Base class updated

Additional Information

@ishantiw ishantiw added the framework/module/interoperability Interoperability module label Nov 1, 2022
@mitsuaki-u mitsuaki-u self-assigned this Nov 2, 2022
@mitsuaki-u mitsuaki-u modified the milestone: Sprint 81 Nov 3, 2022
@shuse2 shuse2 added this to the Sprint 82 milestone Nov 7, 2022
ishantiw added a commit that referenced this issue Nov 14, 2022
### What was the problem?

This PR resolves #7719

### How was it solved?

- Updated all the CCM related contexts to `CrossChainMessageContext`

### How was it tested?

- Updated tests
@shuse2 shuse2 closed this as completed Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
framework/module/interoperability Interoperability module
Projects
None yet
Development

No branches or pull requests

3 participants