Skip to content

Commit

Permalink
Update UPTN (6119) test files
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzdogan committed Jun 28, 2023
1 parent 9e03c81 commit 326ff66
Show file tree
Hide file tree
Showing 5 changed files with 324 additions and 2 deletions.
18 changes: 16 additions & 2 deletions test/chains/chain-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ describe("Test Supported Chains", function () {

before(async function () {
const promisified = util.promisify(server.app.listen);
await promisified(server.port);
console.log(`Injector listening on port ${server.port}!`);
await promisified(3000);
console.log(`Injector listening on port ${3000}!`);
});

beforeEach(() => {
Expand Down Expand Up @@ -891,6 +891,19 @@ describe("Test Supported Chains", function () {
"shared/1_Storage.metadata.json"
);

// UPTN Chain Mainnet
verifyContract(
"0x212F6222fB4937978A806b14FB2725169825078F",
"6119",
"UPTN Chain",
[
"6119/ERC4906.sol",
"6119/UptnNFTsV1.sol",
"6119/IUPTNAddressValidator.sol",
],
"6119/UptnNFTsV1.metadata.json"
);

// Finally check if all the "supported: true" chains have been tested
it("should have tested all supported chains", function (done) {
if (newAddedChainId) {
Expand Down Expand Up @@ -970,6 +983,7 @@ describe("Test Supported Chains", function () {
files: files,
})
.end((err, res) => {
// console.log("error", err, "res", res);
assertVerification(err, res, done, address, chainId);
anyTestsPass = true;
});
Expand Down
12 changes: 12 additions & 0 deletions test/chains/sources/6119/ERC4906.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/interfaces/IERC4906.sol";

abstract contract ERC4906 is ERC165, IERC4906{
/// @dev See {IERC165-supportsInterface}.
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId);
}
}
18 changes: 18 additions & 0 deletions test/chains/sources/6119/IUPTNAddressValidator.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IUPTNAddressValidator {
function isBlacklist(address account) external view returns (bool);
function addBlacklist(address account) external;
function removeBlacklist(address account) external;

function isWhitelist(bytes32 tokenHash, address account) external view returns (bool);
function addWhitelist(bytes32 tokenHash, address account) external;
function removeWhitelist(bytes32 tokenHash, address account) external;

function whitelistPaused(bytes32 tokenHash) external view returns (bool);
function pauseWhitelist(bytes32 tokenHash) external;
function unpauseWhitelist(bytes32 tokenHash) external;

function isValid(bytes32 tokenHash, address fromAccount, address toAccount) external view returns (bool);
}
Loading

0 comments on commit 326ff66

Please sign in to comment.