From 5b298eb1edeeeeb493628f2fb1fc3b828f5f80ff Mon Sep 17 00:00:00 2001 From: Christian Fries Date: Thu, 7 Mar 2024 16:12:15 +0100 Subject: [PATCH] Renamed events (removed payment prefix, renamed asset to token) --- solidity/contracts/dvp-impl/AssetContract.sol | 8 ++++---- solidity/contracts/dvp-impl/PaymentContract.sol | 2 +- .../contracts/dvp-impl/interface/IDecryptionContract.sol | 2 +- .../contracts/dvp-impl/interface/ILockingContract.sol | 8 ++++---- solidity/test/DvP.js | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/solidity/contracts/dvp-impl/AssetContract.sol b/solidity/contracts/dvp-impl/AssetContract.sol index 0ff75d321..16b2e7a0a 100644 --- a/solidity/contracts/dvp-impl/AssetContract.sol +++ b/solidity/contracts/dvp-impl/AssetContract.sol @@ -85,7 +85,7 @@ contract AssetContract is ILockingContract { require(transactionStates[id] == TransactionState.TradeConfirmed, "TransactionState State is not 'TradeConfirmed'"); transactionStates[id] = TransactionState.TransferIncepted; transactionKeys[id].encryptedKeySeller = keyEncryptedSeller; - emit AssetTransferIncepted(transactionSpecs[id].buyer,id); + emit TransferIncepted(transactionSpecs[id].buyer, id); } @@ -97,7 +97,7 @@ contract AssetContract is ILockingContract { TransactionSpec memory txSpec = transactionSpecs[id]; bondHolderBalances[txSpec.seller] -= txSpec.notional; // Decrement Notional from Seller Holder Balance bondHolderBalances[address(this)] += txSpec.notional; // Transfer Bond to INTERNAL Balance and trigger transfer of the paymentAmount - emit AssetTransferConfirmed(transactionSpecs[id].seller,id); + emit TransferConfirmed(transactionSpecs[id].seller, id); } @@ -105,9 +105,9 @@ contract AssetContract is ILockingContract { require(msg.sender == transactionSpecs[id].seller || msg.sender == transactionSpecs[id].buyer, "You are not Seller or Buyer of the referenced Transaction."); uint256 hashedKey = uint256(keccak256(abi.encode(key))); if (msg.sender == transactionSpecs[id].seller) - emit AssetReclaimed(id,key); + emit TokenReclaimed(id, key); if (msg.sender == transactionSpecs[id].buyer) - emit AssetClaimed(id,key); + emit TokenClaimed(id, key); } function checkHashFunction( string memory key, uint256 hashOfKey ) external returns (bool) { diff --git a/solidity/contracts/dvp-impl/PaymentContract.sol b/solidity/contracts/dvp-impl/PaymentContract.sol index 1fe7a3f25..6e00d9f87 100644 --- a/solidity/contracts/dvp-impl/PaymentContract.sol +++ b/solidity/contracts/dvp-impl/PaymentContract.sol @@ -28,7 +28,7 @@ contract PaymentContract is IDecryptionContract { function inceptTransfer(bytes32 id, int amount, address from, string memory keyEncryptedSuccess, string memory keyEncryptedFailure) external override { transactionMap[id] = TransactionSpec(from, msg.sender, amount, keyEncryptedSuccess, keyEncryptedFailure); - emit PaymentTransferIncepted(msg.sender, id, amount); + emit TransferIncepted(msg.sender, id, amount); } diff --git a/solidity/contracts/dvp-impl/interface/IDecryptionContract.sol b/solidity/contracts/dvp-impl/interface/IDecryptionContract.sol index b5424f2f6..fa342fdf7 100644 --- a/solidity/contracts/dvp-impl/interface/IDecryptionContract.sol +++ b/solidity/contracts/dvp-impl/interface/IDecryptionContract.sol @@ -29,7 +29,7 @@ interface IDecryptionContract { * @param id the trade ID. * @param amount to be transfered. */ - event PaymentTransferIncepted(address initiator, bytes32 id, int amount); + event TransferIncepted(address initiator, bytes32 id, int amount); /** * @dev Emitted when a the transfer has been performed with a success or failure. diff --git a/solidity/contracts/dvp-impl/interface/ILockingContract.sol b/solidity/contracts/dvp-impl/interface/ILockingContract.sol index d165e3813..e03d82564 100644 --- a/solidity/contracts/dvp-impl/interface/ILockingContract.sol +++ b/solidity/contracts/dvp-impl/interface/ILockingContract.sol @@ -32,28 +32,28 @@ interface ILockingContract { * @param initiator is the address from which trade was incepted * @param id the trade ID */ - event AssetTransferIncepted(address initiator, bytes32 id); + event TransferIncepted(address initiator, bytes32 id); /** * @dev Emitted when the transfer for the asset is incepted * @param confirmer is the address from which trade was incepted * @param id the trade ID */ - event AssetTransferConfirmed(address confirmer, bytes32 id); + event TransferConfirmed(address confirmer, bytes32 id); /** * @dev Emitted when a confirmed trade is set to active - e.g. when termination fee amounts are provided * @param id the trade ID * @param key the key that was used to claim the asset */ - event AssetClaimed(bytes32 id, string key); + event TokenClaimed(bytes32 id, string key); /** * @dev Emitted when an active trade is terminated * @param id the trade ID * @param key the key that was used to claim the asset */ - event AssetReclaimed(bytes32 id, string key); + event TokenReclaimed(bytes32 id, string key); /*------------------------------------------- FUNCTIONALITY ---------------------------------------------------------------------------------------*/ diff --git a/solidity/test/DvP.js b/solidity/test/DvP.js index 560c94721..ed8c8a8b3 100644 --- a/solidity/test/DvP.js +++ b/solidity/test/DvP.js @@ -96,7 +96,7 @@ const abiCoder = new AbiCoder(); await new Promise((resolve) => setTimeout(resolve, secWait)); console.log("- Buyer calls 'inceptTransfer' against AssetContract providing the encrypted key for Seller"); const call = await deliveryContract.connect(buyer).inceptTransfer(id, assetAmount, seller.address, keyEncrypedAsString) ; - await expect(call).to.emit(deliveryContract, "AssetTransferIncepted"); + await expect(call).to.emit(deliveryContract, "TransferIncepted"); await new Promise((resolve) => setTimeout(resolve, secWait)); }); @@ -116,7 +116,7 @@ const abiCoder = new AbiCoder(); console.log("- Buyer calls 'inceptTransfer' against AssetContract providing the encrypted key for Seller"); // inceptTransfer(uint id, int amount, address from, string memory keyEncryptedSuccess, string memory keyEncryptedFailure) const call = await paymentContract.connect(buyer).inceptTransfer(id, paymentAmount, buyer.address, keyEncrypedBuyerAsString, keyEncrypedSellerAsString) ; - await expect(call).to.emit(paymentContract, "PaymentTransferIncepted"); + await expect(call).to.emit(paymentContract, "TransferIncepted"); await new Promise((resolve) => setTimeout(resolve, secWait)); });