.. _module-splice-tests-testamulettokendvp-14922: Splice.Tests.TestAmuletTokenDvP =============================== Daml script tests showing that the token standard can be used to execute DvP settlements of Amulet tokens; and how to do so\. See this test and the 'Splice\.Testing\.TradingApp' module for an example of how to integrate with the allocation APIs of the token standard to execute DvP settlements\. Note also that the delivery part of a DvP settelement can be both another token implementing the standard, as well as the creation of on\-ledger state specific to your registry; e\.g\., a license contract\. Data Types ---------- .. _type-splice-tests-testamulettokendvp-allocatedotctrade-90362: **data** `AllocatedOTCTrade `_ .. _constr-splice-tests-testamulettokendvp-allocatedotctrade-19245: `AllocatedOTCTrade `_ .. list-table:: :widths: 15 10 30 :header-rows: 1 * - Field - Type - Description * - alice - `Party `_ - * - bob - `Party `_ - * - provider - `Party `_ - * - providerBeneficiary1 - `Party `_ - * - providerBeneficiary2 - `Party `_ - * - providerBeneficiaries - \[(`Party `_, `Decimal `_)\] - * - registry - :ref:`AmuletRegistry ` - * - otcTradeCid - `ContractId `_ :ref:`OTCTrade ` - * - otcTrade - :ref:`OTCTrade ` - * - amuletId - InstrumentId - **instance** `Eq `_ `AllocatedOTCTrade `_ **instance** `Show `_ `AllocatedOTCTrade `_ **instance** `GetField `_ \"alice\" `AllocatedOTCTrade `_ `Party `_ **instance** `GetField `_ \"amuletId\" `AllocatedOTCTrade `_ InstrumentId **instance** `GetField `_ \"bob\" `AllocatedOTCTrade `_ `Party `_ **instance** `GetField `_ \"otcTrade\" `AllocatedOTCTrade `_ :ref:`OTCTrade ` **instance** `GetField `_ \"otcTradeCid\" `AllocatedOTCTrade `_ (`ContractId `_ :ref:`OTCTrade `) **instance** `GetField `_ \"provider\" `AllocatedOTCTrade `_ `Party `_ **instance** `GetField `_ \"providerBeneficiaries\" `AllocatedOTCTrade `_ \[(`Party `_, `Decimal `_)\] **instance** `GetField `_ \"providerBeneficiary1\" `AllocatedOTCTrade `_ `Party `_ **instance** `GetField `_ \"providerBeneficiary2\" `AllocatedOTCTrade `_ `Party `_ **instance** `GetField `_ \"registry\" `AllocatedOTCTrade `_ :ref:`AmuletRegistry ` **instance** `SetField `_ \"alice\" `AllocatedOTCTrade `_ `Party `_ **instance** `SetField `_ \"amuletId\" `AllocatedOTCTrade `_ InstrumentId **instance** `SetField `_ \"bob\" `AllocatedOTCTrade `_ `Party `_ **instance** `SetField `_ \"otcTrade\" `AllocatedOTCTrade `_ :ref:`OTCTrade ` **instance** `SetField `_ \"otcTradeCid\" `AllocatedOTCTrade `_ (`ContractId `_ :ref:`OTCTrade `) **instance** `SetField `_ \"provider\" `AllocatedOTCTrade `_ `Party `_ **instance** `SetField `_ \"providerBeneficiaries\" `AllocatedOTCTrade `_ \[(`Party `_, `Decimal `_)\] **instance** `SetField `_ \"providerBeneficiary1\" `AllocatedOTCTrade `_ `Party `_ **instance** `SetField `_ \"providerBeneficiary2\" `AllocatedOTCTrade `_ `Party `_ **instance** `SetField `_ \"registry\" `AllocatedOTCTrade `_ :ref:`AmuletRegistry ` Functions --------- .. _function-splice-tests-testamulettokendvp-setupotctrade-96214: `setupOtcTrade `_ \: Script `AllocatedOTCTrade `_ .. _function-splice-tests-testamulettokendvp-testdvp-18055: `testDvP `_ \: Script () Test that a DvP settlement of an OTC trade works when using Amulet via the token standard\. .. _function-splice-tests-testamulettokendvp-appbackendlistallocations-88475: `appBackendListAllocations `_ \: `Party `_ \-\> Reference \-\> Script (`TextMap `_ (`ContractId `_ Allocation, AllocationView)) List all allocations matching a particular settlement reference, sorted by their tradeLeg id\. This function would be run on the trading app provider's backend as part of an automation loop\. .. _function-splice-tests-testamulettokendvp-expectburn-98454: `expectBurn `_ \: Metadata \-\> Script ()