From 127a3e53f99826bd4906326aecffc848b199eb3f Mon Sep 17 00:00:00 2001 From: matthme <36768177+matthme@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:52:45 +0100 Subject: [PATCH] fix: ChainIntegrityWarrant type (#312) (#313) * fix ChainIntegrityWarrant type * build docs --- docs/client.chainintegritywarrant.md | 10 ++++---- src/hdk/dht-ops.ts | 36 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/client.chainintegritywarrant.md b/docs/client.chainintegritywarrant.md index 89dbe007..b14eecb7 100644 --- a/docs/client.chainintegritywarrant.md +++ b/docs/client.chainintegritywarrant.md @@ -13,11 +13,11 @@ export type ChainIntegrityWarrant = { action_author: AgentPubKey; action: ActionHashAndSig; validation_type: ValidationType; - } | { - ChainFork: { - chain_author: AgentPubKey; - action_pair: [ActionHashAndSig, ActionHashAndSig]; - }; + }; +} | { + ChainFork: { + chain_author: AgentPubKey; + action_pair: [ActionHashAndSig, ActionHashAndSig]; }; }; ``` diff --git a/src/hdk/dht-ops.ts b/src/hdk/dht-ops.ts index 6bc12939..862f1264 100644 --- a/src/hdk/dht-ops.ts +++ b/src/hdk/dht-ops.ts @@ -88,31 +88,31 @@ export interface Warrant { /** * @public */ -export type ChainIntegrityWarrant = { - /** - * Something invalid was authored on a chain. - * When we receive this warrant, we fetch the Action and validate it - * under every applicable DhtOpType. - */ - InvalidChainOp: - | { +export type ChainIntegrityWarrant = + | { + /** + * Something invalid was authored on a chain. + * When we receive this warrant, we fetch the Action and validate it + * under every applicable DhtOpType. + */ + InvalidChainOp: { /** The author of the action */ action_author: AgentPubKey; /** The hash of the action to fetch by */ action: ActionHashAndSig; /** Whether to run app or sys validation */ validation_type: ValidationType; - } - | { - /** Proof of chain fork. */ - ChainFork: { - /** Author of the chain which is forked */ - chain_author: AgentPubKey; - /** Two actions of the same seq number which prove the fork */ - action_pair: [ActionHashAndSig, ActionHashAndSig]; - }; }; -}; + } + | { + /** Proof of chain fork. */ + ChainFork: { + /** Author of the chain which is forked */ + chain_author: AgentPubKey; + /** Two actions of the same seq number which prove the fork */ + action_pair: [ActionHashAndSig, ActionHashAndSig]; + }; + }; /** * @public