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

Create base interoperability store #7018

Closed
Tracked by #6915
ishantiw opened this issue Feb 18, 2022 · 0 comments · Fixed by #7066
Closed
Tracked by #6915

Create base interoperability store #7018

ishantiw opened this issue Feb 18, 2022 · 0 comments · Fixed by #7066
Assignees
Labels
framework/module/interoperability Interoperability module
Milestone

Comments

@ishantiw
Copy link
Contributor

ishantiw commented Feb 18, 2022

Description

Interoperability Store will take getStore(modID, store_prefix) => KVStore and InteroperableModules as arguments in the constructor and will provide all the. BaseInteroperabilityStore abstract class should be created under /framework/src/modules.

export abstract class BaseInteroperabilityStore {
	private _interopModules: Map<number, InteroperableModule>;
	private _getStore: (modID, store_prefix) => KVStore;

	constructor(getStore, interoperableModules) {
		this._interopModules = interoperableModules;
		this._getStore = getStore;
	}
	public abstract apply(ccu, ccm) {}
	public abstract forward(ccu, ccm) {} // only used in mainchain
	public abstract bounce(ccu, ccm) {} // only used in mainchain
	public abstract sendInternal(sendInternalContext) {} // same as the API
	public abstract appendToInboxTree(chainID, appendData) {}
	public abstract appendToOutboxTree(chainID, appendData) {}
	public abstract addToOutbox(chainID, ccm) {}
	public abstract addToInbox(chainID, ccm) {}
	public abstract isLive(chainID) {} // different in mainchain and sidechain
	public abstract terminateChainInternal(chainID) {}
	public abstract terminatedStateAccount(chainID) {}
	public abstract createTerminatedOutboxAccount(chainID, outboxRoot, outboxSize, partnerChainInboxSize) {}
	public abstract getInboxRoot(chainID): Buffer {}
	public abstract getOutboxRoot(chainID): Buffer {}
	public abstract getChainAccount(chainID): PartnerChainData {}
	public abstract getChannel(chainID): ChannelData {}
}

validateFormat() func can be added to utils.ts as it doesn't require subStore

Usage

Usage of Interoperability in other classes is by creating a file store.ts with a class extending the BaseInteroperabilityStore and implements the functions required to enable interoperability.

Acceptance Criteria

  • BaseInteroperabilityStore abstract class should exist under /framework/src/modules
@ishantiw ishantiw changed the title Create interoperability store Create base interoperability store Feb 18, 2022
@ishantiw ishantiw moved this to Backlog in Lisk SDK Version 6.0.0 Feb 18, 2022
@ishantiw ishantiw added framework/module/interoperability Interoperability module and removed framework labels Feb 23, 2022
@milenagojkovic milenagojkovic added this to the Sprint 64 milestone Feb 28, 2022
@milenagojkovic milenagojkovic moved this from Backlog to ToDo in Lisk SDK Version 6.0.0 Feb 28, 2022
@milenagojkovic milenagojkovic moved this from ToDo to Pending Review in Lisk SDK Version 6.0.0 Mar 4, 2022
@milenagojkovic milenagojkovic linked a pull request Mar 4, 2022 that will close this issue
ishantiw added a commit that referenced this issue Mar 4, 2022
…y-store

Base create interoperability store - Closes #7018
@ishantiw ishantiw closed this as completed Mar 9, 2022
Repository owner moved this from Pending Review to Done in Lisk SDK Version 6.0.0 Mar 9, 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

Successfully merging a pull request may close this issue.

2 participants