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

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
Member

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 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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework/module/interoperability Interoperability module
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants