-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
647e598
commit ab0191d
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
pragma solidity 0.8.17; | ||
|
||
import "../../contracts/vault/receipt/ReceiptVault.sol"; | ||
|
||
import "forge-std/Test.sol"; | ||
|
||
import "../../contracts/vault/offchainAsset/OffchainAssetReceiptVaultFactory.sol"; | ||
import "../../contracts/vault/offchainAsset/OffchainAssetReceiptVault.sol"; | ||
|
||
contract OffChainAssetReceiptVaultTest is Test { | ||
OffchainAssetReceiptVaultFactory factory; | ||
OffchainAssetVaultConfig offchainAssetVaultConfig; | ||
ReceiptVaultConfig receiptVaultConfig; | ||
VaultConfig vaultConfig; | ||
OffchainAssetReceiptVault implementation; | ||
ReceiptVault receiptVault; | ||
|
||
event Certify(address sender, uint256 certifyUntil, uint256 referenceBlockNumber, bool forceUntil, bytes data); | ||
|
||
function setUp() public { | ||
implementation = new OffchainAssetReceiptVault(); | ||
receiptVault = new ReceiptVault(); | ||
|
||
vaultConfig = VaultConfig( | ||
address(0), | ||
"Asset Name", | ||
"ASSET" | ||
); | ||
|
||
receiptVaultConfig = ReceiptVaultConfig( | ||
address(receiptVault), | ||
vaultConfig | ||
); | ||
|
||
offchainAssetVaultConfig = OffchainAssetVaultConfig( | ||
address(0xc0D477556c25C9d67E1f57245C7453DA776B51cf), | ||
vaultConfig | ||
); | ||
|
||
factory = new OffchainAssetReceiptVaultFactory(ReceiptVaultFactoryConfig(address(implementation), address(receiptVault))); | ||
} | ||
|
||
function test_Certify() public { | ||
|
||
|
||
OffchainAssetReceiptVault child = factory.createChildTyped(offchainAssetVaultConfig); | ||
child.grantRole(child.CERTIFIER(), msg.sender); | ||
|
||
// vaultContract.balanceOf(msg.sender);//.grantRole(vaultContract.CERTIFIER(), msg.sender); | ||
// vm.expectEmit(true, true, true, true); | ||
|
||
// expected emitted event | ||
// emit Certify(msg.sender, 100, 10, false, abi.encodePacked("Certification data")); | ||
// | ||
// vaultContract.certify(100, 10, false, abi.encodePacked("Certification data")); | ||
|
||
} | ||
} |