-
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
3a1ecde
commit d9d252e
Showing
5 changed files
with
113 additions
and
61 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
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
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
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
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,45 @@ | ||
// SPDX-License-Identifier: LicenseRef-DCL-1.0 | ||
// SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd | ||
pragma solidity =0.8.25; | ||
|
||
import {ReceiptFactoryTest} from "test/abstract/ReceiptFactoryTest.sol"; | ||
import {TestReceiptManager} from "test/concrete/TestReceiptManager.sol"; | ||
import {Receipt as ReceiptContract} from "src/concrete/receipt/Receipt.sol"; | ||
|
||
contract ReceiptMetadataTest is ReceiptFactoryTest { | ||
function testReceiptURI(uint256 id) external { | ||
// Deploy the Receipt contract | ||
TestReceiptManager testManager = new TestReceiptManager(); | ||
ReceiptContract receipt = | ||
ReceiptContract(iFactory.clone(address(iReceiptImplementation), abi.encode(address(testManager)))); | ||
|
||
string memory uri = receipt.uri(id); | ||
|
||
Metadata memory metadataJson = decodeMetadataURI(uri); | ||
|
||
assertEq( | ||
metadataJson.description, | ||
"1 of these receipts can be burned alongside 1 TRM to redeem TRMAsset from the vault." | ||
); | ||
assertEq(metadataJson.decimals, 18); | ||
assertEq(metadataJson.name, "TRM Receipt"); | ||
} | ||
|
||
function testReceiptName() external { | ||
// Deploy the Receipt contract | ||
TestReceiptManager testManager = new TestReceiptManager(); | ||
ReceiptContract receipt = | ||
ReceiptContract(iFactory.clone(address(iReceiptImplementation), abi.encode(address(testManager)))); | ||
|
||
assertEq(receipt.name(), "TRM Receipt"); | ||
} | ||
|
||
function testReceiptSymbol() external { | ||
// Deploy the Receipt contract | ||
TestReceiptManager testManager = new TestReceiptManager(); | ||
ReceiptContract receipt = | ||
ReceiptContract(iFactory.clone(address(iReceiptImplementation), abi.encode(address(testManager)))); | ||
|
||
assertEq(receipt.symbol(), "TRM RCPT"); | ||
} | ||
} |