From 07cafb4b7b67875d4f24331b90d3c9e32d54249e Mon Sep 17 00:00:00 2001 From: David Misiak Date: Wed, 16 Feb 2022 16:56:53 +0100 Subject: [PATCH] feat(cardano): allow device-owned outputs in plutus txs --- docs/methods/cardanoSignTransaction.md | 1 - tests/__fixtures__/cardanoSignTransaction.js | 32 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/methods/cardanoSignTransaction.md b/docs/methods/cardanoSignTransaction.md index 3ec9af232..2ca40f3d9 100644 --- a/docs/methods/cardanoSignTransaction.md +++ b/docs/methods/cardanoSignTransaction.md @@ -85,7 +85,6 @@ Represents a transactions containing Plutus script evaluation. The transaction w The transaction - *should* contain `scriptDataHash` and `collateralInputs` -- *must not* contain output addresses given by parameters - *must not* contain a pool registration certificate - *may* contain only 1852, 1854 and 1855 required signers - *may* contain only 1852, 1854 and 1855 witness requests diff --git a/tests/__fixtures__/cardanoSignTransaction.js b/tests/__fixtures__/cardanoSignTransaction.js index a5a30bf88..e02a193ac 100644 --- a/tests/__fixtures__/cardanoSignTransaction.js +++ b/tests/__fixtures__/cardanoSignTransaction.js @@ -1769,6 +1769,38 @@ export default { ], }, + { + description: 'plutusWithDeviceOwnedOutput', + params: { + inputs: [SAMPLE_INPUTS.external_input], + outputs: [ + SAMPLE_OUTPUTS.simple_shelley_output, + SAMPLE_OUTPUTS.base_address_change_output, + ], + fee: FEE, + ttl: TTL, + protocolMagic: PROTOCOL_MAGICS.mainnet, + networkId: NETWORK_IDS.mainnet, + signingMode: CardanoTxSigningMode.PLUTUS_TRANSACTION, + scriptDataHash: SCRIPT_DATA_HASH, + collateralInputs: [SAMPLE_INPUTS.shelley_input], + }, + result: { + hash: 'b201b4b2d889f931020fe0f3f637cd3fbe79fae460ab24fd61182e48e9bc975a', + witnesses: [ + { + type: 1, + pubKey: '5d010cf16fdeff40955633d6c565f3844a288a24967cf6b76acbeb271b4f13c1', + signature: + 'd84707a76565c5f748679cd3a46b93ba0c1aec37e49d8e87fbb6785738c19bd10b311af9eddc22e520b43ef0a4a6e934be7917ff87456522a6378d84e431d207', + chainCode: null, + }, + ], + auxiliaryDataSupplement: undefined, + }, + legacyResults: [legacyResults.beforePlutus], + }, + { description: 'plutusTransactionWithTokenMinting', params: {