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

Aligning DB contract table with domain.ActiveContract class #3989

Merged
merged 2 commits into from
Jan 8, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix TypeScript domain models
remove witnessParties and workflowId fields. workflowId has be removed
from JSON output a while ago.
  • Loading branch information
leo-da committed Jan 8, 2020
commit c57194ca7e9f87b066bfe8f660305f1432b3c3c6
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@ export type CreateEvent<T extends object> = {
agreementText: Text;
key: unknown;
payload: T;
witnessParties: List<Party>;
workflowId?: string;
}

export type ArchiveEvent<T extends object> = {
templateId: TemplateId;
contractId: ContractId<T>;
witnessParties: List<Party>;
}

export type Event<T extends object> =
Expand All @@ -40,8 +37,6 @@ const decodeCreateEvent = <T extends object>(template: Template<T>): jtv.Decoder
agreementText: Text.decoder(),
key: jtv.unknownJson(),
payload: template.decoder(),
witnessParties: List(Party).decoder(),
workflowId: jtv.optional(jtv.string()),
});

const decodeCreateEventUnknown: jtv.Decoder<CreateEvent<object>> =
Expand All @@ -52,7 +47,6 @@ const decodeCreateEventUnknown: jtv.Decoder<CreateEvent<object>> =
const decodeArchiveEventUnknown: jtv.Decoder<ArchiveEvent<object>> = jtv.object({
templateId: decodeTemplateId,
contractId: ContractId({decoder: jtv.unknownJson}).decoder(),
witnessParties: List(Party).decoder(),
});

const decodeEventUnknown: jtv.Decoder<Event<object>> = jtv.oneOf<Event<object>>(
Expand Down