Skip to content

Commit

Permalink
(test): fix interface of trust
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminbollen committed Mar 26, 2024
1 parent 120ad5c commit ad04407
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions test/migration/MockHub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,36 @@ contract MockHubV1 is IHubV1 {

// State variables

// simplify to boolean trust
mapping(address => mapping(address => bool)) public trusts;

mapping(address => address) public userToToken;
mapping(address => address) public tokenToUser;

// External functions

function signup() external pure {
notMocked();
}
function signup() external {
require(address(userToToken[msg.sender]) == address(0), "You can't sign up twice");

function organizationSignup() external pure {
notMocked();
Token token = new Token(msg.sender);
userToToken[msg.sender] = address(token);
tokenToUser[address(token)] = msg.sender;
// every user must trust themselves with a weight of 100
// this is so that all users accept their own token at all times
trust(msg.sender, 100);
}

function tokenToUser(address /*token*/ ) external pure returns (address) {
function organizationSignup() external pure {
notMocked();
return address(0);
}

function limits(address, /*truster*/ address /*trustee*/ ) external pure returns (uint256) {
notMocked();
return uint256(0);
}

function trust(address, /*trustee*/ uint256 /*limit*/ ) external pure {
notMocked();
function trust(address _trustee, uint256 _limit) public {
trusts[msg.sender][_trustee] = _limit > 0 ? true : false;
}

function issuance() external view returns (uint256) {
Expand Down

0 comments on commit ad04407

Please sign in to comment.