validateChallengeWitnessfunction
Checks a complete authored witness through the public deterministic rules API.
Import it
import { validateChallengeWitness } from "@johnmorrisdotca/houseki/gem-swap";
Definition
function validateChallengeWitness(options: CreateOptions, witness: readonly ReplayOperation[]): { readonly valid: boolean; readonly state?: GameState; readonly reason?: string; }
Parameters
| Name | Type | Description |
|---|---|---|
options | CreateOptions | Validated native creation, authored challenge, or environment options described by this signature. |
witness | readonly ReplayOperation[] | The ordered native replay operations proposed as a winning challenge proof. |
Returns
{ readonly valid: boolean; readonly state?: GameState; readonly reason?: string; }
Checks a complete authored witness through the public deterministic rules API.
Examples
import { GEM_SWAP_CAMPAIGN, validateChallengeWitness } from "@johnmorrisdotca/houseki/gem-swap";
console.log(validateChallengeWitness(GEM_SWAP_CAMPAIGN[0].options,GEM_SWAP_CAMPAIGN[0].witness).valid);trueWhat it prints (run when this page was built)