> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# Splice.Testing.Utils

> Documentation for Splice.Testing.Utils

Testing utilities to simplify testing token standard usage and implementation.

## Data Types

**data** Disclosures'

> A set of disclosures. Used to work around the fact that duplicate disclosures for the same contract are not allowed.
>
> Disclosures'
>
> > | Field | Type | Description |
> > | - | - | - |
> > | disclosures | [Map](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-map-90052) AnyContractId Disclosure | |
>
> **instance** [Monoid](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-prelude-monoid-6742) Disclosures'
>
> **instance** [Semigroup](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-prelude-semigroup-78998) Disclosures'
>
> **instance** GetField "disclosures" Disclosures' ([Map](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-map-90052) AnyContractId Disclosure)
>
> **instance** GetField "disclosures" (EnrichedFactoryChoice t ch) Disclosures'
>
> **instance** GetField "disclosures" OpenApiChoiceContext Disclosures'
>
> **instance** SetField "disclosures" Disclosures' ([Map](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-map-90052) AnyContractId Disclosure)
>
> **instance** SetField "disclosures" (EnrichedFactoryChoice t ch) Disclosures'
>
> **instance** SetField "disclosures" OpenApiChoiceContext Disclosures'

**data** EnrichedFactoryChoice t ch

> A choice on a factory contract enriched with an appropriate choice-context and disclosures.
>
> EnrichedFactoryChoice
>
> > | Field | Type | Description |
> > | - | - | - |
> > | factoryCid | [ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) t | |
> > | arg | ch | |
> > | disclosures | Disclosures' | |
>
> **instance** GetField "arg" (EnrichedFactoryChoice t ch) ch
>
> **instance** GetField "disclosures" (EnrichedFactoryChoice t ch) Disclosures'
>
> **instance** GetField "factoryCid" (EnrichedFactoryChoice t ch) ([ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) t)
>
> **instance** SetField "arg" (EnrichedFactoryChoice t ch) ch
>
> **instance** SetField "disclosures" (EnrichedFactoryChoice t ch) Disclosures'
>
> **instance** SetField "factoryCid" (EnrichedFactoryChoice t ch) ([ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) t)

**data** FailureStatusCheck

> FailureStatusCheck
>
> > | Field | Type | Description |
> > | - | - | - |
> > | check | FailureStatus -> [Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952) | |
>
> **instance** [Semigroup](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-prelude-semigroup-78998) FailureStatusCheck
>
> **instance** GetField "check" FailureStatusCheck (FailureStatus -> [Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952))
>
> **instance** SetField "check" FailureStatusCheck (FailureStatus -> [Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952))

**data** OpenApiChoiceContext

> A representation of a ChoiceContext and disclosed contracts as they would be returned by the an OpenAPI endpoint of the token standard.
>
> OpenApiChoiceContext
>
> > | Field | Type | Description |
> > | - | - | - |
> > | choiceContext | ChoiceContext | |
> > | disclosures | Disclosures' | |
>
> **instance** [Semigroup](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-da-internal-prelude-semigroup-78998) OpenApiChoiceContext
>
> **instance** GetField "choiceContext" OpenApiChoiceContext ChoiceContext
>
> **instance** GetField "disclosures" OpenApiChoiceContext Disclosures'
>
> **instance** SetField "choiceContext" OpenApiChoiceContext ChoiceContext
>
> **instance** SetField "disclosures" OpenApiChoiceContext Disclosures'

## Functions

emptyExtraArgs
: ExtraArgs

Use this to construct an empty 'ExtraArgs' record.

withExtraDisclosures
: Disclosures' -> OpenApiChoiceContext -> OpenApiChoiceContext

Add extra disclosures to an 'OpenApiChoiceContext'.

queryDisclosure'
: [Template](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-template-functions-template-31804) t => [Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) -> [ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) t -> Script Disclosures'

Retrieve a disclosed contract by its contract-id from a specific party's ACS.

submitWithDisclosures'
: [Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) -> Disclosures' -> Commands a -> Script a

Version of 'submitWithDisclosures' that works with the simplified `Disclosures'` type.

submitWithDisclosuresMustFail'
: [Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) -> Disclosures' -> Commands a -> Script ()

Version of 'submitWithDisclosuresMustFail' that works with the simplified `Disclosures'` type.

allocatePartyExact
: [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952) -> Script [Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932)

Allocate party with a specific name.

submitWithDisclosuresMustFail''
: [Show](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-show-show-65360) a => FailureStatusCheck -> [Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) -> Disclosures' -> Commands a -> Script ()

Use this to check that commands fail with the expected 'FailureStatus'.

submitMultiMustFail''
: [Show](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#class-ghc-show-show-65360) a => FailureStatusCheck -> \[[Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932)] -> \[[Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932)] -> Commands a -> Script ()

Use this to check that multi-party submission fails with the expected 'FailureStatus'.

expectErrorId
: [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952) -> FailureStatusCheck

expectMessageContains
: [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952) -> FailureStatusCheck

expectUnmetRequirement
: [Text](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-text-51952) -> FailureStatusCheck

expectFailureStatus
: (FailureStatus -> [Bool](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-bool-66265)) -> FailureStatusCheck
