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

Return JSON types from interoperability endpoints #7334

Closed
Tracked by #7210
ishantiw opened this issue Jul 25, 2022 · 0 comments · Fixed by #7336
Closed
Tracked by #7210

Return JSON types from interoperability endpoints #7334

ishantiw opened this issue Jul 25, 2022 · 0 comments · Fixed by #7336
Assignees
Labels
framework/module/interoperability Interoperability module
Milestone

Comments

@ishantiw
Copy link
Contributor

Description

We have to return JSON format results from interoperability endpoints.

getChainAccount

getChainAccount(context: ModuleEndpointContext, chainID: Buffer): Promise<ChainAccountJSON>

where ChainAccountJSON is,

interface ChainAccountJSON {
	name: string;
	networkID: string;
	lastCertificate: LastCertificateJSON;
	status: number;
}
export interface LastCertificateJSON {
	height: number;
	timestamp: number;
	stateRoot: string;
	validatorsHash: string;
}

getChannel

public async getChannel(context: ModuleEndpointContext, chainID: Buffer): Promise<ChannelDataJSON> 

where ChannelDataJSON is,

export interface ChannelDataJSON {
	inbox: InboxJSON;
	outbox: OutboxJSON;
	partnerChainOutboxRoot: string;
	messageFeeTokenID: MessageFeeTokenIDJSON;
}
export interface MessageFeeTokenIDJSON {
	chainID: string;
	localID: string;
}
export interface OutboxJSON {
	appendPath: string[];
	size: number;
	root: string;
}
export interface InboxJSON {
	appendPath: string[];
	size: number;
	root: string;
}

getOwnChainAccount

getOwnChainAccount(context: ModuleEndpointContext): Promise<OwnChainAccountJSON>

where OwnChainAccountJSON is,

export interface OwnChainAccountJSON {
	name: string;
	id: string;
	nonce: string;
}

getTerminatedStateAccount

getTerminatedStateAccount(context: ModuleEndpointContext, chainID: Buffer): Promise<TerminatedStateAccountJSON>

where TerminatedStateAccountJSON is,

export interface TerminatedStateAccountJSON {
	stateRoot: string;
	mainchainStateRoot?: string;
	initialized?: boolean;
}

getTerminatedOutboxAccount

getTerminatedOutboxAccount(context: ModuleEndpointContext, chainID: Buffer): Promise<TerminatedOutboxAccountJSON>

where TerminatedOutboxAccountJSON is,

export interface TerminatedOutboxAccountJSON {
	outboxRoot: string;
	outboxSize: number;
	partnerChainInboxSize: number;
}

Acceptance Criteria

Update/add all unit tests for the interoperability endpoints

@ishantiw ishantiw added the framework/module/interoperability Interoperability module label Jul 25, 2022
@ishantiw ishantiw added this to the Sprint 74 milestone Jul 25, 2022
@ishantiw ishantiw self-assigned this Jul 25, 2022
ishantiw added a commit that referenced this issue Jul 27, 2022
Return JSON format results from endpoints - Closes #7334
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.

1 participant