From a5ad56735c9ea29d1218ae3526cb9ceee81f87cd Mon Sep 17 00:00:00 2001 From: Geolffrey Mena Date: Fri, 3 Jan 2025 12:46:26 -0600 Subject: [PATCH] test: asset vault expected valid owner --- contracts/assets/AssetOwnership.sol | 3 ++- contracts/core/primitives/BasePolicy.sol | 2 +- contracts/economics/Treasury.sol | 1 - contracts/financial/AgreementSettler.sol | 4 +++- test/assets/AssetVault.t.sol | 5 +++++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/contracts/assets/AssetOwnership.sol b/contracts/assets/AssetOwnership.sol index 935fa1b..a82a273 100644 --- a/contracts/assets/AssetOwnership.sol +++ b/contracts/assets/AssetOwnership.sol @@ -80,7 +80,8 @@ contract AssetOwnership is // TODO build getURI => from distributor custodian /erc721-metadata // TODO transfer ownership + fee - // TODO: approved content get an incentive: a cooling mechanism is needed eg: leg decay, max registered asset rate, etc + // TODO: approved content get an incentive: a cooling mechanism is needed eg: + // log decay, max registered asset rate, etc /// @notice Mints a new NFT representing an asset to the specified address. /// @dev The assumption is that only those who know the asset ID diff --git a/contracts/core/primitives/BasePolicy.sol b/contracts/core/primitives/BasePolicy.sol index e5689f7..f5deb02 100644 --- a/contracts/core/primitives/BasePolicy.sol +++ b/contracts/core/primitives/BasePolicy.sol @@ -24,7 +24,7 @@ abstract contract BasePolicy is IPolicy, ERC165 { mapping(bytes32 => uint256) private _attestations; /// @notice Emitted when an enforcement process is successfully completed for a given account. - /// @param context The attested agreement key map relations. eg: (account & holder address), (account & asset id), etc + /// @param context The attested agreement key map relations. eg: (account & holder), (account & asset id) /// @param account The address of the user whose access or compliance is being enforced. /// @param attestationId The unique identifier of the attestations that confirms compliance or access. event AttestedAgreement(bytes32 indexed context, address indexed account, uint256 attestationId); diff --git a/contracts/economics/Treasury.sol b/contracts/economics/Treasury.sol index e8c1b72..98fb8b0 100644 --- a/contracts/economics/Treasury.sol +++ b/contracts/economics/Treasury.sol @@ -96,7 +96,6 @@ contract Treasury is emit FeesCollected(collectors[i], collected, currency); totalCollected += collected; } - } /// @notice Function that should revert when msg.sender is not authorized to upgrade the contract. diff --git a/contracts/financial/AgreementSettler.sol b/contracts/financial/AgreementSettler.sol index b983a8e..199aa1b 100644 --- a/contracts/financial/AgreementSettler.sol +++ b/contracts/financial/AgreementSettler.sol @@ -97,7 +97,9 @@ contract AgreementSettler is // eg: access handling for gating content. etc.. // function isAccessAllowed(bytes calldata criteria) external view return (bool) { // // get registered access hooks for this contract - // IHook hook = HOOKS.get(address(this), IAccessHook) <- internal handling of any logic needed to get the valid hook + // IHook hook = HOOKS.get(address(this), IAccessHook) <- internal handling of any logic needed + // to get the valid hook + // if (!hook) return false // need conf hook // return hook.exec(criteria) //} diff --git a/test/assets/AssetVault.t.sol b/test/assets/AssetVault.t.sol index 3dfdab2..20c46bb 100644 --- a/test/assets/AssetVault.t.sol +++ b/test/assets/AssetVault.t.sol @@ -51,6 +51,11 @@ contract AssetVaultTest is BaseTest { assert(keccak256(abi.encodePacked(expected)) == keccak256(abi.encodePacked(b64))); } + function test_SetContent_StoredEventEmitted() public { + vm.warp(1641070800); + vm.prank(user); + } + function test_SetContent_RevertIf_InvalidOwner() public { vm.warp(1641070800); vm.prank(user);