Skip to content

Commit

Permalink
feat: tests (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
nachomazzara authored Jul 17, 2020
1 parent 204996d commit baa0437
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
10 changes: 10 additions & 0 deletions contracts/estate/EstateRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -663,4 +663,14 @@ contract EstateRegistry is Migratable, IEstateRegistry, ERC721Token, ERC721Recei
estateLandBalance.generateTokens(_to, _amount);
}
}

/**
* @dev Set a estate land balance minime token hardcoded because of the
* contraint of the proxy for using an owner
* Mainnet: 0x8568f23f343694650370fe5e254b55bfb704a6c7
*/
function setEstateLandBalanceToken() external {
require(estateLandBalance == address(0), "estateLandBalance was set");
_setEstateLandBalanceToken(address(0x8568f23f343694650370fe5e254b55bfb704a6c7));
}
}
10 changes: 10 additions & 0 deletions full/EstateRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1731,4 +1731,14 @@ contract EstateRegistry is Migratable, IEstateRegistry, ERC721Token, ERC721Recei
estateLandBalance.generateTokens(_to, _amount);
}
}

/**
* @dev Set a estate land balance minime token hardcoded because of the
* contraint of the proxy for using an owner
* Mainnet: 0x8568f23f343694650370fe5e254b55bfb704a6c7
*/
function setEstateLandBalanceToken() external {
require(estateLandBalance == address(0), "estateLandBalance was set");
_setEstateLandBalanceToken(address(0x8568f23f343694650370fe5e254b55bfb704a6c7));
}
}
5 changes: 1 addition & 4 deletions test/EstateRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -1698,10 +1698,7 @@ contract('EstateRegistry', accounts => {

describe('setBalanceToken', function() {
it('should set balance token', async function() {
const { logs } = await estate.setEstateLandBalanceToken(
user,
sentByCreator
)
const { logs } = await estate.setEstateLandBalance(user, sentByCreator)

// Event emitted
logs.length.should.be.equal(1)
Expand Down
2 changes: 1 addition & 1 deletion test/EstateRegistryTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ contract EstateRegistryTest is EstateRegistry {
);
}

function setEstateLandBalanceToken(address _newEstateLandBalance) public {
function setEstateLandBalance(address _newEstateLandBalance) public {
_setEstateLandBalanceToken(_newEstateLandBalance);
}
}
2 changes: 1 addition & 1 deletion test/helpers/setupContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default async function setupContracts(creator) {
await land.setLandBalanceToken(landMinimeToken.address)

await estateMinimeToken.changeController(estate.address, sentByCreator)
await estate.setEstateLandBalanceToken(estateMinimeToken.address)
await estate.setEstateLandBalance(estateMinimeToken.address)

return {
proxy,
Expand Down

0 comments on commit baa0437

Please sign in to comment.