diff --git a/packages/format/src/types/program/context.ts b/packages/format/src/types/program/context.ts index 7c4e4ea4c..d221f3437 100644 --- a/packages/format/src/types/program/context.ts +++ b/packages/format/src/types/program/context.ts @@ -169,8 +169,9 @@ export namespace Context { Invoke.isInvocation(value.invoke); export namespace Invoke { - export type Invocation = Function.Identity & - ( + export type Invocation = Function.Identity & { + activation?: string; + } & ( | Invocation.InternalCall | Invocation.ExternalCall | Invocation.ContractCreation @@ -180,7 +181,8 @@ export namespace Context { Function.isIdentity(value) && (Invocation.isInternalCall(value) || Invocation.isExternalCall(value) || - Invocation.isContractCreation(value)); + Invocation.isContractCreation(value)) && + (!("activation" in value) || typeof value.activation === "string"); export namespace Invocation { export interface InternalCall extends Function.Identity { @@ -254,6 +256,7 @@ export namespace Context { export interface Info extends Function.Identity { data?: Function.PointerRef; success?: Function.PointerRef; + activation?: string; } export const isInfo = (value: unknown): value is Info => @@ -261,7 +264,8 @@ export namespace Context { typeof value === "object" && !!value && (!("data" in value) || Function.isPointerRef(value.data)) && - (!("success" in value) || Function.isPointerRef(value.success)); + (!("success" in value) || Function.isPointerRef(value.success)) && + (!("activation" in value) || typeof value.activation === "string"); } export interface Revert { @@ -278,6 +282,7 @@ export namespace Context { export interface Info extends Function.Identity { reason?: Function.PointerRef; panic?: number; + activation?: string; } export const isInfo = (value: unknown): value is Info => @@ -285,7 +290,8 @@ export namespace Context { typeof value === "object" && !!value && (!("reason" in value) || Function.isPointerRef(value.reason)) && - (!("panic" in value) || typeof value.panic === "number"); + (!("panic" in value) || typeof value.panic === "number") && + (!("activation" in value) || typeof value.activation === "string"); } export interface Transform {