validateChallengeWitness関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Checks a complete authored witness through the public deterministic rules API.
インポート
import { validateChallengeWitness } from "@johnmorrisdotca/houseki/gem-swap";
定義
function validateChallengeWitness(options: CreateOptions, witness: readonly ReplayOperation[]): { readonly valid: boolean; readonly state?: GameState; readonly reason?: string; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
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. |
戻り値
{ readonly valid: boolean; readonly state?: GameState; readonly reason?: string; }
Checks a complete authored witness through the public deterministic rules API.
例
import { GEM_SWAP_CAMPAIGN, validateChallengeWitness } from "@johnmorrisdotca/houseki/gem-swap";
console.log(validateChallengeWitness(GEM_SWAP_CAMPAIGN[0].options,GEM_SWAP_CAMPAIGN[0].witness).valid);true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。