Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Divide-By-0 committed Apr 3, 2024
1 parent 13b41c2 commit 77ab2dc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
"dependencies": {
"@openzeppelin/contracts": "^5.0.0",
"dotenv": "^16.3.1"
},
"devDependencies": {
"forge-std": "https://github.com/foundry-rs/forge-std"
}
}
4 changes: 3 additions & 1 deletion packages/contracts/remappings.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
@openzeppelin/contracts=../../node_modules/@openzeppelin/contracts
@openzeppelin=../../node_modules/@openzeppelin/contracts
@openzeppelin=../../node_modules/@openzeppelin/contracts
forge-std=../../node_modules/forge-std

23 changes: 23 additions & 0 deletions packages/contracts/test/DKIMRegistry.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

import "@openzeppelin/contracts/utils/Strings.sol";
import "forge-std/src/Test.sol";
import "forge-std/src/console.sol";
import "../interfaces/IDKIMRegistry.sol";
import "../DKIMRegistry.sol";

/// @title ECDSAOwnedDKIMRegistry
/// @notice A DKIM Registry that could be updated by predefined ECDSA signer
contract TestDKIMRegistry is Test {
DKIMRegistry public dkimRegistry;
address public signer;

constructor() {
dkimRegistry = new DKIMRegistry(msg.sender);
signer = msg.sender;
}

function test_setDKIM() public {
dkimRegistry.setDKIMPublicKeyHash("test.com", "a81273981273bce922");
}
}

8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2773,6 +2773,7 @@ __metadata:
dependencies:
"@openzeppelin/contracts": ^5.0.0
dotenv: ^16.3.1
forge-std: "https://github.com/foundry-rs/forge-std"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -4195,6 +4196,13 @@ __metadata:
languageName: node
linkType: hard

"forge-std@https://github.com/foundry-rs/forge-std":
version: 1.7.6
resolution: "forge-std@https://github.com/foundry-rs/forge-std.git#commit=e4aef94c1768803a16fe19f7ce8b65defd027cfd"
checksum: 6fab51b92a24c97384f55dcb1b9eba29ce5043b67930b4179a9f9f4f8da85e8315163db60bec2ffbe7334135755630ba549b246db9e503e59ec93ba2f11931cc
languageName: node
linkType: hard

"fs-minipass@npm:^2.0.0, fs-minipass@npm:^2.1.0":
version: 2.1.0
resolution: "fs-minipass@npm:2.1.0"
Expand Down

0 comments on commit 77ab2dc

Please sign in to comment.