Skip to content

Commit

Permalink
Expose APMNamehash (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai authored May 23, 2018
1 parent ea80727 commit 37d973f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
12 changes: 12 additions & 0 deletions contracts/apm/APMNamehash.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
pragma solidity ^0.4.18;

import "../ens/ENSConstants.sol";


contract APMNamehash is ENSConstants {
bytes32 constant public APM_NODE = keccak256(ETH_TLD_NODE, keccak256("aragonpm"));

function apmNamehash(string name) internal pure returns (bytes32) {
return keccak256(APM_NODE, keccak256(name));
}
}
11 changes: 0 additions & 11 deletions test/mocks/APMNamehash.sol

This file was deleted.

4 changes: 2 additions & 2 deletions test/mocks/APMNamehashWrapper.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pragma solidity 0.4.18;

import "./APMNamehash.sol";
import "../../contracts/apm/APMNamehash.sol";


contract APMNamehashWrapper is APMNamehash {
event LogHash(string name, bytes32 hash);

function getAPMNamehash(string name) public returns (bytes32 hash) {
hash = apmNamehash(name);
LogHash("eth node", ETH_NODE);
LogHash("eth node", ETH_TLD_NODE);
LogHash("aragonpm.eth", APM_NODE);
LogHash(name, hash);
return hash;
Expand Down

0 comments on commit 37d973f

Please sign in to comment.