From 982e227e86086a32a2b8542bdfa2f0e9dfe84cc8 Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Thu, 29 Aug 2019 21:28:05 -0500 Subject: [PATCH 1/9] spitting the docker compose for the test net with no block time. --- packages/kosu-geth/docker-compose.test.yml | 9 +++++++++ packages/kosu-geth/package.json | 1 + 2 files changed, 10 insertions(+) create mode 100644 packages/kosu-geth/docker-compose.test.yml diff --git a/packages/kosu-geth/docker-compose.test.yml b/packages/kosu-geth/docker-compose.test.yml new file mode 100644 index 00000000..5ade0d89 --- /dev/null +++ b/packages/kosu-geth/docker-compose.test.yml @@ -0,0 +1,9 @@ +version: '3' +services: + kosu: + build: + context: . + dockerfile: kosu-test.Dockerfile + ports: + - 8545:8545 + - 8546:8546 diff --git a/packages/kosu-geth/package.json b/packages/kosu-geth/package.json index a05c35f6..7ca65a19 100644 --- a/packages/kosu-geth/package.json +++ b/packages/kosu-geth/package.json @@ -8,6 +8,7 @@ "geth:init": "yarn geth:clean && geth init genesis.json --datadir .", "geth:start:old": "geth --datadir . --networkid 6174 --rpc --rpcaddr '0.0.0.0' --unlock=\"`cat accounts`\" --password=./passwords --etherbase \"0x54E60Bccc86A7Bad4BC68E36a8fde0F369aE849E\" --mine --rpccorsdomain '*' --rpcapi 'personal,db,eth,net,web3,txpool,miner,debug' console", "kosu:start": "docker-compose up --force-recreate --build", + "kosu:test:start": "docker-compose -f docker-compose.test.yml up --force-recreate --build", "build:kosu": "scripts/build-and-push-geth-image.sh kosu.Dockerfile ${npm_package_config_image_host} kosu-geth ${npm_package_version}", "build:kosu-test": "scripts/build-and-push-geth-image.sh kosu-test.Dockerfile ${npm_package_config_image_host} kosu-test-geth ${npm_package_version}", "build_and_push": "yarn build:kosu && yarn build:kosu-test" From dd8a017d911f5d207308eb7d79c2fbe556961c52 Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Wed, 4 Sep 2019 14:20:49 -0500 Subject: [PATCH 2/9] Adding revert messages and adding some tests that were used to explore correct syntax to reliably get responses from various providers. --- .../access_control/AuthorizedAddresses.sol | 2 +- .../contracts/base/Authorizable.sol | 2 +- .../contracts/lib/KosuToken.sol | 4 +- .../contracts/treasury/Treasury.sol | 8 +- .../contracts/validator/ValidatorRegistry.sol | 50 ++++----- .../contracts/voting/Voting.sol | 30 ++--- .../kosu-system-contracts/test/kosu_token.ts | 9 ++ .../test/validator_registry.ts | 104 +++++++++++------- 8 files changed, 122 insertions(+), 87 deletions(-) diff --git a/packages/kosu-system-contracts/contracts/access_control/AuthorizedAddresses.sol b/packages/kosu-system-contracts/contracts/access_control/AuthorizedAddresses.sol index c956c819..06703c2f 100644 --- a/packages/kosu-system-contracts/contracts/access_control/AuthorizedAddresses.sol +++ b/packages/kosu-system-contracts/contracts/access_control/AuthorizedAddresses.sol @@ -23,7 +23,7 @@ contract AuthorizedAddresses is Ownable { @param a Address to authorize */ function authorizeAddress(address a) public { - require(authorizedAddresses[msg.sender]); + require(authorizedAddresses[msg.sender], "unauthorized"); authorizedAddresses[a] = true; } diff --git a/packages/kosu-system-contracts/contracts/base/Authorizable.sol b/packages/kosu-system-contracts/contracts/base/Authorizable.sol index 5c5c69c4..9db91670 100644 --- a/packages/kosu-system-contracts/contracts/base/Authorizable.sol +++ b/packages/kosu-system-contracts/contracts/base/Authorizable.sol @@ -23,7 +23,7 @@ contract Authorizable { @notice Ensures msg.sender is authorized within the AuthorizedAddresses contract */ modifier isAuthorized() { - require(authorizedAddress.isAddressAuthorized(msg.sender)); + require(authorizedAddress.isAddressAuthorized(msg.sender), "Unauthorized"); _; } } diff --git a/packages/kosu-system-contracts/contracts/lib/KosuToken.sol b/packages/kosu-system-contracts/contracts/lib/KosuToken.sol index 917e5e9d..1ccb5f44 100644 --- a/packages/kosu-system-contracts/contracts/lib/KosuToken.sol +++ b/packages/kosu-system-contracts/contracts/lib/KosuToken.sol @@ -38,7 +38,7 @@ contract KosuToken is ERC20, Authorizable { uint tokensToMint = calculateEtherToToken(msg.value); - require(tokensToMint >= minPayout); + require(tokensToMint >= minPayout, "payout below requested minimum"); _weiPaid = _weiPaid.add(msg.value); _mint(msg.sender, tokensToMint); @@ -98,7 +98,7 @@ contract KosuToken is ERC20, Authorizable { */ function calculateEtherToToken(uint etherValue) internal view returns (uint) { if (_weiPaid == 0 && totalSupply() == 0) { - require(etherValue == (2 ether)/10); + require(etherValue == (2 ether)/10, "First transaction must be .2 ether"); return 10000 ether; } else { return Formula.calculatePurchaseReturn(totalSupply(), _weiPaid, r, etherValue); diff --git a/packages/kosu-system-contracts/contracts/treasury/Treasury.sol b/packages/kosu-system-contracts/contracts/treasury/Treasury.sol index 895a3119..48a5b410 100644 --- a/packages/kosu-system-contracts/contracts/treasury/Treasury.sol +++ b/packages/kosu-system-contracts/contracts/treasury/Treasury.sol @@ -117,7 +117,7 @@ contract Treasury is Authorizable { //Remove the system balance setSystemBalance(account, getSystemBalance(account).sub(amount)); // Require the tokens being confiscated are only tokens already in kosu system contract control - require(getSystemBalance(account) >= getCurrentBalance(account)); + require(getSystemBalance(account) >= getCurrentBalance(account), "system balance overburn"); } /** @dev Allows accounts to be rewarded with tokens. These tokens were previously obtained by the calling contract and are now being redistributed to the provided account. @@ -140,7 +140,7 @@ contract Treasury is Authorizable { @param amount Number of tokens to burn. */ function burnFrom(address account, uint amount) isAuthorized public { - require(getCurrentBalance(account) >= amount); + require(getCurrentBalance(account) >= amount, "insufficient current balance"); kosuToken.burn(amount); //TODO: Consider event? setCurrentBalance(account, getCurrentBalance(account).sub(amount)); setSystemBalance(account, getSystemBalance(account).sub(amount)); @@ -213,7 +213,7 @@ contract Treasury is Authorizable { function _bond(address account) internal returns (uint) { uint initialBalance = kosuToken.balanceOf(address(this)); uint minted = kosuToken.bondTokens.value(msg.value)(0); - require(initialBalance+minted == kosuToken.balanceOf(address(this))); + require(initialBalance + minted == kosuToken.balanceOf(address(this)), "tokens not minted"); setSystemBalance(account, getSystemBalance(account).add(minted)); setCurrentBalance(account, getCurrentBalance(account).add(minted)); @@ -234,7 +234,7 @@ contract Treasury is Authorizable { */ function _withdraw(address account, uint amount) internal { //Sends tokens to the account reduce the values of internal and system balances by the value. - require(getCurrentBalance(account) >= amount); + require(getCurrentBalance(account) >= amount, "insufficient tokens"); require(kosuToken.transfer(account, amount)); setSystemBalance(account, getSystemBalance(account).sub(amount)); setCurrentBalance(account, getCurrentBalance(account).sub(amount)); diff --git a/packages/kosu-system-contracts/contracts/validator/ValidatorRegistry.sol b/packages/kosu-system-contracts/contracts/validator/ValidatorRegistry.sol index 1abdcf53..2ec375c1 100644 --- a/packages/kosu-system-contracts/contracts/validator/ValidatorRegistry.sol +++ b/packages/kosu-system-contracts/contracts/validator/ValidatorRegistry.sol @@ -207,7 +207,7 @@ contract ValidatorRegistry is Ownable { */ function registerListing(bytes32 tendermintPublicKey, uint tokensToStake, int rewardRate, string calldata details) external { //tokensToStake must be greater than or equal to _minimumBalance - require(tokensToStake >= minimumBalance); + require(tokensToStake >= minimumBalance, "must register with at least minimum balance"); //Claim tokens from the treasury treasury.claimTokens(msg.sender, tokensToStake); @@ -216,9 +216,10 @@ contract ValidatorRegistry is Ownable { Listing storage listing = _listings[tendermintPublicKey]; //Must not overwrite an existing listing - require(listing.status == Status.NULL); + require(listing.status == Status.NULL, "listing with public key exists"); + if (rewardRate > 0) { - require(uint(rewardRate) <= maxRewardRate()); + require(uint(rewardRate) <= maxRewardRate(), "reward rate exceeds max"); } //Set listing values @@ -247,7 +248,7 @@ contract ValidatorRegistry is Ownable { Listing storage listing = _listings[tendermintPublicKey]; //Challenge pending and accepted listings. -- More valid status may be added. - require(listing.status == Status.PENDING || listing.status == Status.ACCEPTED || listing.status == Status.EXITING); + require(listing.status == Status.PENDING || listing.status == Status.ACCEPTED || listing.status == Status.EXITING, "listing is not pending, accepted or exiting"); //Ensure earns and burns are up to date return if a touch and remove was executed _processRewards(listing); @@ -289,10 +290,10 @@ contract ValidatorRegistry is Ownable { Challenge storage challenge = _challenges[listing.currentChallenge]; //Must be currently challenged and after the end block but not finalized - require(listing.status == Status.CHALLENGED); - require(block.number > challenge.challengeEnd); - require(!challenge.finalized); - require(challenge.balance == listing.stakedBalance); + require(listing.status == Status.CHALLENGED, "listing is not challenged"); + require(block.number > challenge.challengeEnd, "challenge has not ended"); + require(!challenge.finalized, "challenge has been finalized"); + require(challenge.balance == listing.stakedBalance, "challenge balance has changed"); uint winningOption = voting.winningOption(challenge.pollId); @@ -357,9 +358,6 @@ contract ValidatorRegistry is Ownable { listing.currentChallenge = 0; _emitValidatorChallengeResolved(listing); } - - //ensure the ending state is correct - require(challenge.balance == challenge.voterTotal); } } @@ -371,16 +369,13 @@ contract ValidatorRegistry is Ownable { Challenge storage challenge = _challenges[challengeId]; //Must be after challenge period - require(block.number > challenge.challengeEnd); + require(block.number > challenge.challengeEnd, "challenge hasn't ended"); //Finalize the challenge if (!challenge.finalized) { resolveChallenge(challenge.listingKey); } - //Ensure finalize has been completed - require(challenge.finalized); - //Get vote info uint winningTokens = voting.userWinningTokens(challenge.pollId, msg.sender); uint totalWinningTokens = voting.totalWinningTokens(challenge.pollId); @@ -413,8 +408,9 @@ contract ValidatorRegistry is Ownable { Listing storage listing = _listings[tendermintPublicKey]; //Must be called by owner after application period - require(listing.owner == msg.sender); - require(listing.status == Status.PENDING && listing.applicationBlock.add(applicationPeriod) <= block.number); + require(listing.owner == msg.sender, "not listing owner"); + require(listing.status == Status.PENDING, "listing not pending"); + require(listing.applicationBlock.add(applicationPeriod) <= block.number, "application period active"); //Listing is now accepted listing.status = Status.ACCEPTED; @@ -446,7 +442,7 @@ contract ValidatorRegistry is Ownable { Listing storage listing = _listings[tendermintPublicKey]; //Listing owner must call this method - require(listing.owner == msg.sender); + require(listing.owner == msg.sender, "not listing owner"); //Exit immediately if the listing is still in pending status. if (listing.status == Status.PENDING) { @@ -461,7 +457,7 @@ contract ValidatorRegistry is Ownable { } //Ensure listing is in accepted - require(listing.status == Status.ACCEPTED); + require(listing.status == Status.ACCEPTED, "listing not accepted"); listing.status = Status.EXITING; listing.exitBlock = block.number + exitPeriod; @@ -479,11 +475,11 @@ contract ValidatorRegistry is Ownable { Listing storage listing = _listings[tendermintPublicKey]; //Listing owner must call this method - require(listing.owner == msg.sender); + require(listing.owner == msg.sender, "not listing owner"); //The listing must be exiting and past the exit block challenge interrupts this process - require(listing.status == Status.EXITING); - require(listing.exitBlock <= block.number); + require(listing.status == Status.EXITING, "listing not exiting"); + require(listing.exitBlock <= block.number, "exiting cool off period active"); //Approve and release tokens to treasury kosuToken.approve(address(treasury), listing.stakedBalance); @@ -503,15 +499,15 @@ contract ValidatorRegistry is Ownable { Listing storage listing = _listings[tendermintPublicKey]; //Listing owner must call this method - require(listing.owner == msg.sender); + require(listing.owner == msg.sender, "not listing owner"); //Can only modify listing generating tokens - require(listing.rewardRate > 0); + require(listing.rewardRate > 0, "listing is not generating tokens"); //Can only reduce reward rate - require(listing.rewardRate > newRate); + require(listing.rewardRate > newRate, "not reducing reward rate"); //Must be below the maxRewardRate - require(uint(newRate) < maxRewardRate()); + require(uint(newRate) < maxRewardRate(), "exceeds maximum reward rate"); //Listing must be active and in good standing. - require(listing.status == Status.ACCEPTED); + require(listing.status == Status.ACCEPTED, "listing is not accepted"); _processRewards(listing); listing.rewardRate = newRate; diff --git a/packages/kosu-system-contracts/contracts/voting/Voting.sol b/packages/kosu-system-contracts/contracts/voting/Voting.sol index 44558b7e..efe99ae9 100644 --- a/packages/kosu-system-contracts/contracts/voting/Voting.sol +++ b/packages/kosu-system-contracts/contracts/voting/Voting.sol @@ -55,7 +55,7 @@ contract Voting { */ function createPoll(uint _commitEndBlock, uint _revealEndBlock) public returns (uint) {//TODO is it a concern that polls could be created by anyone freely? // Reveal end after commit - require(_commitEndBlock < _revealEndBlock); + require(_commitEndBlock < _revealEndBlock, "commit must end before reveal"); // Set poll data Poll storage p = polls[nextPollId]; @@ -91,10 +91,10 @@ contract Voting { Vote storage v = p.votes[msg.sender]; //Ensure commit phase hasn't ended, the user has not committed and has adequate balance in the treasury - require(block.number <= p.commitEndBlock); - require(!p.didCommit[msg.sender]); - require(treasury.registerVote(msg.sender, _pollId, _tokensToCommit)); - require(_tokensToCommit > 0); + require(block.number <= p.commitEndBlock, "commit has ended"); + require(!p.didCommit[msg.sender], "address committed"); + require(treasury.registerVote(msg.sender, _pollId, _tokensToCommit), "insufficient tokens"); + require(_tokensToCommit > 0, "must commit tokens to lock"); //Set the tokens committed hidden vote data v.tokensCommitted = _tokensToCommit; @@ -115,15 +115,15 @@ contract Voting { Vote storage v = p.votes[msg.sender]; // Ensure commit phase has passed, reveal phase has not. User has commited but not revealed. User has adequate balance in the treasury. - require(block.number > p.commitEndBlock); - require(block.number <= p.revealEndBlock); - require(p.didCommit[msg.sender]); - require(!p.didReveal[msg.sender]); - require(treasury.completeVote(msg.sender, _pollId)); + require(block.number > p.commitEndBlock, "commit hasn't ended"); + require(block.number <= p.revealEndBlock, "reveal has ended"); + require(p.didCommit[msg.sender], "address hasn't committed"); + require(!p.didReveal[msg.sender], "address has revealed"); + require(treasury.completeVote(msg.sender, _pollId), "token's broke lock"); // Calculate and compare the commited vote bytes32 exposedVote = keccak256(abi.encodePacked(_voteOption, _voteSalt)); - require(v.hiddenVote == exposedVote); + require(v.hiddenVote == exposedVote, "vote doesn't match"); // Store info from a valid revealed vote. Remove the pending vote. v.salt = _voteSalt; @@ -146,7 +146,7 @@ contract Voting { */ function winningOption(uint _pollId) public view returns (uint) { Poll memory p = polls[_pollId]; - require(p.revealEndBlock < block.number); + require(p.revealEndBlock < block.number, "poll hasn't ended"); return p.currentLeadingOption; } @@ -156,7 +156,7 @@ contract Voting { */ function totalWinningTokens(uint _pollId) public view returns (uint) { Poll memory p = polls[_pollId]; - require(p.revealEndBlock < block.number); + require(p.revealEndBlock < block.number, "poll hasn't ended"); return p.leadingTokens; } @@ -166,7 +166,7 @@ contract Voting { */ function totalRevealedTokens(uint _pollId) public view returns (uint) { Poll memory p = polls[_pollId]; - require(p.revealEndBlock < block.number); + require(p.revealEndBlock < block.number, "poll hasn't ended"); return p.totalRevealedTokens; } @@ -176,7 +176,7 @@ contract Voting { */ function userWinningTokens(uint _pollId, address _user) public view returns (uint tokens) { Poll memory p = polls[_pollId]; - require(p.revealEndBlock < block.number); + require(p.revealEndBlock < block.number, "poll hasn't ended"); Vote memory v = polls[_pollId].votes[_user]; if(p.currentLeadingOption == v.voteOption) { diff --git a/packages/kosu-system-contracts/test/kosu_token.ts b/packages/kosu-system-contracts/test/kosu_token.ts index 5859466f..020cc4d6 100644 --- a/packages/kosu-system-contracts/test/kosu_token.ts +++ b/packages/kosu-system-contracts/test/kosu_token.ts @@ -125,6 +125,15 @@ describe("KosuToken", () => { .toString() .should.eq(endingEther.toString()); }); + + it("should fail with payout below minPayout", async () => { + const estimate = await kosuToken.estimateEtherToToken.callAsync(TestValues.oneEther); + + await kosuToken.bondTokens + .callAsync(estimate.plus(TestValues.oneEther), { value: TestValues.oneEther }) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("payout below requested minimum"); + }); }); describe("releaseTokens", () => { diff --git a/packages/kosu-system-contracts/test/validator_registry.ts b/packages/kosu-system-contracts/test/validator_registry.ts index a8d7ec2b..a35173b3 100644 --- a/packages/kosu-system-contracts/test/validator_registry.ts +++ b/packages/kosu-system-contracts/test/validator_registry.ts @@ -100,7 +100,7 @@ describe("ValidatorRegistry", async () => { TestValues.oneWei, ); - txReceipt.gasUsed.should.be.lt(5100000); + txReceipt.gasUsed.should.be.lt(5500000); }); }); @@ -184,13 +184,23 @@ describe("ValidatorRegistry", async () => { it("should require a balance greater or equal to the minimumBalance", async () => { const from = accounts[1]; const idleBalance = await kosuToken.balanceOf.callAsync(from); + await testHelpers.clearTreasury(from) await kosuToken.transfer.awaitTransactionSuccessAsync(accounts[0], idleBalance, { from }); await kosuToken.balanceOf .callAsync(from) .then(x => x.toString()) .should.eventually.eq("0"); - await validatorRegistry.registerListing.awaitTransactionSuccessAsync( + await treasury.systemBalance + .callAsync(from) + .then(x => x.toString()) + .should.eventually.eq(minimumBalance.times(2).toString(), "systemBalance"); + await treasury.currentBalance + .callAsync(from) + .then(x => x.toString()) + .should.eventually.eq("0", "currentBalance"); + + await validatorRegistry.registerListing.sendTransactionAsync( tendermintPublicKey, minimumBalance, TestValues.zero, @@ -198,7 +208,7 @@ describe("ValidatorRegistry", async () => { { from }, ).should.eventually.be.rejected; - kosuToken.transfer.awaitTransactionSuccessAsync(from, idleBalance, { from: accounts[0] }); + await kosuToken.transfer.awaitTransactionSuccessAsync(from, idleBalance, { from: accounts[0] }); }); it("should require an approval greater or equal to the minimumBalance", async () => { @@ -247,12 +257,16 @@ describe("ValidatorRegistry", async () => { TestValues.zero, paradigmMarket, ).should.eventually.be.fulfilled; - await validatorRegistry.registerListing.awaitTransactionSuccessAsync( + + await kosuToken.approve.awaitTransactionSuccessAsync(treasury.address, minimumBalance); + + await validatorRegistry.registerListing.callAsync( tendermintPublicKey, minimumBalance, TestValues.zero, paradigmMarket, - ).should.eventually.be.rejected; + ).should.eventually.be.rejected.and.have.property("message") + .that.includes("listing with public key exists"); }); it("should set the listing status to pending", async () => { @@ -323,12 +337,13 @@ describe("ValidatorRegistry", async () => { it("should fail with less tokens than minimum", async () => { const minimum = await validatorRegistry.minimumBalance.callAsync(); - await validatorRegistry.registerListing.awaitTransactionSuccessAsync( + await validatorRegistry.registerListing.callAsync( tendermintPublicKey, minimum.minus(new BigNumber("1")), TestValues.zero, paradigmMarket, - ).should.eventually.be.rejected; + ).should.eventually.be.rejected.and.have.property("message") + .that.includes("must register with at least minimum balance"); await validatorRegistry.registerListing.awaitTransactionSuccessAsync( tendermintPublicKey, minimum, @@ -339,12 +354,13 @@ describe("ValidatorRegistry", async () => { it("should fail when you try to generate too many tokens", async () => { const max = await validatorRegistry.maxRewardRate.callAsync(); - await validatorRegistry.registerListing.awaitTransactionSuccessAsync( + await validatorRegistry.registerListing.callAsync( tendermintPublicKey, minimumBalance, max.plus(new BigNumber("1")), paradigmMarket, - ).should.eventually.be.rejected; + ).should.eventually.be.rejected.and.have.property("message") + .that.includes("reward rate exceeds max"); await validatorRegistry.registerListing.awaitTransactionSuccessAsync( tendermintPublicKey, minimumBalance, @@ -403,8 +419,9 @@ describe("ValidatorRegistry", async () => { describe("confirmListing", () => { it("should not confirm a null listing", async () => { - await validatorRegistry.confirmListing.awaitTransactionSuccessAsync(tendermintPublicKey).should.eventually - .be.rejected; + await validatorRegistry.confirmListing.callAsync(tendermintPublicKey).should.eventually + .be.rejected.and.have.property("message") + .that.includes("not listing owner"); }); it("should require sufficient blocks to pass before confirmation", async () => { @@ -416,8 +433,9 @@ describe("ValidatorRegistry", async () => { paradigmMarket, ); const appBlock = decodeKosuEvents(result.logs)[0].applicationBlockNumber; - await validatorRegistry.confirmListing.awaitTransactionSuccessAsync(tendermintPublicKey).should.eventually - .be.rejected; + await validatorRegistry.confirmListing.callAsync(tendermintPublicKey).should.eventually + .be.rejected.and.have.property("message") + .that.includes("application period active"); await testHelpers.skipApplicationPeriod(appBlock); @@ -451,8 +469,9 @@ describe("ValidatorRegistry", async () => { tendermintPublicKey, paradigmMarket, ).should.eventually.be.fulfilled; - await validatorRegistry.confirmListing.awaitTransactionSuccessAsync(tendermintPublicKey).should - .eventually.be.rejected; + await validatorRegistry.confirmListing.callAsync(tendermintPublicKey).should + .eventually.be.rejected.and.have.property("message") + .that.includes("listing not pending"); await testHelpers.skipChallengePeriod(result.blockNumber); await validatorRegistry.resolveChallenge.awaitTransactionSuccessAsync(tendermintPublicKey).should @@ -463,9 +482,10 @@ describe("ValidatorRegistry", async () => { }); it("should only let the listing owner confirm the listing", async () => { - await validatorRegistry.confirmListing.awaitTransactionSuccessAsync(tendermintPublicKey, { + await validatorRegistry.confirmListing.callAsync(tendermintPublicKey, { from: accounts[1], - }).should.eventually.be.rejected; + }).should.eventually.be.rejected.and.have.property("message") + .that.includes("not listing owner"); await validatorRegistry.confirmListing.awaitTransactionSuccessAsync(tendermintPublicKey).should .eventually.be.fulfilled; await testHelpers.exitListing(tendermintPublicKey); @@ -516,8 +536,9 @@ describe("ValidatorRegistry", async () => { { from: accounts[1] }, ).should.eventually.be.fulfilled; - await validatorRegistry.initExit.awaitTransactionSuccessAsync(tendermintPublicKey).should.eventually.be - .rejected; + await validatorRegistry.initExit.callAsync(tendermintPublicKey).should.eventually.be + .rejected.and.have.property("message") + .that.includes("listing not accepted"); await testHelpers.finishChallenge(tendermintPublicKey, result.blockNumber); await testHelpers.exitListing(tendermintPublicKey); @@ -528,9 +549,10 @@ describe("ValidatorRegistry", async () => { .be.fulfilled; // should only let the owner initExit - await validatorRegistry.initExit.awaitTransactionSuccessAsync(tendermintPublicKey, { + await validatorRegistry.initExit.callAsync(tendermintPublicKey, { from: accounts[1], - }).should.eventually.be.rejected; + }).should.eventually.be.rejected.and.have.property("message") + .that.includes("not listing owner"); const iniitalMaxRewardRate = await validatorRegistry.maxRewardRate.callAsync(); @@ -565,15 +587,17 @@ describe("ValidatorRegistry", async () => { .eventually.be.fulfilled; // should not allow a listing to exit until after the exit period - await validatorRegistry.finalizeExit.awaitTransactionSuccessAsync(tendermintPublicKey).should.eventually.be - .rejected; + await validatorRegistry.finalizeExit.callAsync(tendermintPublicKey).should.eventually.be + .rejected.and.have.property("message") + .that.includes("exiting cool off period active"); await testHelpers.skipExitPeriod(result.blockNumber); // should only let the owner finalizeExit - await validatorRegistry.finalizeExit.awaitTransactionSuccessAsync(tendermintPublicKey, { + await validatorRegistry.finalizeExit.callAsync(tendermintPublicKey, { from: accounts[1], - }).should.eventually.be.rejected; + }).should.eventually.be.rejected.and.have.property("message") + .that.includes("not listing owner"); const oldReward = await validatorRegistry.maxRewardRate.callAsync(); @@ -786,8 +810,9 @@ describe("ValidatorRegistry", async () => { }); // should require challenge to be ended - await validatorRegistry.resolveChallenge.awaitTransactionSuccessAsync(tendermintPublicKey).should.eventually - .be.rejected; + await validatorRegistry.resolveChallenge.callAsync(tendermintPublicKey).should.eventually + .be.rejected.and.have.property("message") + .that.includes("challenge has not ended"); await testHelpers.skipChallengePeriod(blockNumber); const initialListingHolderSystemBalance = await treasury.systemBalance.callAsync(accounts[0]); @@ -799,8 +824,9 @@ describe("ValidatorRegistry", async () => { .should.eventually.be.fulfilled; // should fail if called a second time - await validatorRegistry.resolveChallenge.awaitTransactionSuccessAsync(tendermintPublicKey).should.eventually - .be.rejected; + await validatorRegistry.resolveChallenge.callAsync(tendermintPublicKey).should.eventually + .be.rejected.and.have.property("message") + .that.includes("listing is not challenged"); const decodedLogs = decodeKosuEvents(result.logs); decodedLogs[1].eventType.should.eq("ValidatorRemoved"); @@ -1338,9 +1364,10 @@ describe("ValidatorRegistry", async () => { from: accounts[5], }); - await validatorRegistry.claimWinnings.awaitTransactionSuccessAsync(new BigNumber(challengeId), { + await validatorRegistry.claimWinnings.callAsync(new BigNumber(challengeId), { from: accounts[5], - }).should.eventually.be.rejected; + }).should.eventually.be.rejected.and.have.property("message") + .that.includes("challenge hasn't ended"); await testHelpers.skipChallengePeriod(blockNumber); await validatorRegistry.claimWinnings.awaitTransactionSuccessAsync(new BigNumber(challengeId), { @@ -1759,24 +1786,27 @@ describe("ValidatorRegistry", async () => { it("should not modify a negative reward", async () => { await testHelpers.prepareConfirmedListing("0xffaabb", { reward: TestValues.oneWei.times("-1") }); - await validatorRegistry.reduceReward.awaitTransactionSuccessAsync("0xffaabb", TestValues.zero).should - .eventually.be.rejected; + await validatorRegistry.reduceReward.callAsync("0xffaabb", TestValues.zero).should + .eventually.be.rejected.and.have.property("message") + .that.includes("listing is not generating tokens"); await testHelpers.exitListing("0xffaabb"); }); it("should not modify a zero reward", async () => { await testHelpers.prepareConfirmedListing("0xffaabb"); - await validatorRegistry.reduceReward.awaitTransactionSuccessAsync("0xffaabb", TestValues.oneWei).should - .eventually.be.rejected; + await validatorRegistry.reduceReward.callAsync("0xffaabb", TestValues.oneWei).should + .eventually.be.rejected.and.have.property("message") + .that.includes("listing is not generating tokens"); await testHelpers.exitListing("0xffaabb"); }); it("should not increase a reward", async () => { await testHelpers.prepareConfirmedListing("0xffaabb", { reward: TestValues.oneWei }); - await validatorRegistry.reduceReward.awaitTransactionSuccessAsync( + await validatorRegistry.reduceReward.callAsync( "0xffaabb", TestValues.oneWei.plus(TestValues.oneWei), - ).should.eventually.be.rejected; + ).should.eventually.be.rejected.and.have.property("message") + .that.includes("not reducing reward rate"); await testHelpers.exitListing("0xffaabb"); }); }); From 68ceabf40721dcbf31fcb7cf3d719a25d8c01cf8 Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Mon, 9 Sep 2019 09:53:18 -0500 Subject: [PATCH 3/9] Running prettier. --- .../test/validator_registry.ts | 137 +++++++++--------- 1 file changed, 72 insertions(+), 65 deletions(-) diff --git a/packages/kosu-system-contracts/test/validator_registry.ts b/packages/kosu-system-contracts/test/validator_registry.ts index a35173b3..8503bbb1 100644 --- a/packages/kosu-system-contracts/test/validator_registry.ts +++ b/packages/kosu-system-contracts/test/validator_registry.ts @@ -184,7 +184,7 @@ describe("ValidatorRegistry", async () => { it("should require a balance greater or equal to the minimumBalance", async () => { const from = accounts[1]; const idleBalance = await kosuToken.balanceOf.callAsync(from); - await testHelpers.clearTreasury(from) + await testHelpers.clearTreasury(from); await kosuToken.transfer.awaitTransactionSuccessAsync(accounts[0], idleBalance, { from }); await kosuToken.balanceOf @@ -260,12 +260,9 @@ describe("ValidatorRegistry", async () => { await kosuToken.approve.awaitTransactionSuccessAsync(treasury.address, minimumBalance); - await validatorRegistry.registerListing.callAsync( - tendermintPublicKey, - minimumBalance, - TestValues.zero, - paradigmMarket, - ).should.eventually.be.rejected.and.have.property("message") + await validatorRegistry.registerListing + .callAsync(tendermintPublicKey, minimumBalance, TestValues.zero, paradigmMarket) + .should.eventually.be.rejected.and.have.property("message") .that.includes("listing with public key exists"); }); @@ -337,12 +334,9 @@ describe("ValidatorRegistry", async () => { it("should fail with less tokens than minimum", async () => { const minimum = await validatorRegistry.minimumBalance.callAsync(); - await validatorRegistry.registerListing.callAsync( - tendermintPublicKey, - minimum.minus(new BigNumber("1")), - TestValues.zero, - paradigmMarket, - ).should.eventually.be.rejected.and.have.property("message") + await validatorRegistry.registerListing + .callAsync(tendermintPublicKey, minimum.minus(new BigNumber("1")), TestValues.zero, paradigmMarket) + .should.eventually.be.rejected.and.have.property("message") .that.includes("must register with at least minimum balance"); await validatorRegistry.registerListing.awaitTransactionSuccessAsync( tendermintPublicKey, @@ -354,12 +348,9 @@ describe("ValidatorRegistry", async () => { it("should fail when you try to generate too many tokens", async () => { const max = await validatorRegistry.maxRewardRate.callAsync(); - await validatorRegistry.registerListing.callAsync( - tendermintPublicKey, - minimumBalance, - max.plus(new BigNumber("1")), - paradigmMarket, - ).should.eventually.be.rejected.and.have.property("message") + await validatorRegistry.registerListing + .callAsync(tendermintPublicKey, minimumBalance, max.plus(new BigNumber("1")), paradigmMarket) + .should.eventually.be.rejected.and.have.property("message") .that.includes("reward rate exceeds max"); await validatorRegistry.registerListing.awaitTransactionSuccessAsync( tendermintPublicKey, @@ -419,9 +410,10 @@ describe("ValidatorRegistry", async () => { describe("confirmListing", () => { it("should not confirm a null listing", async () => { - await validatorRegistry.confirmListing.callAsync(tendermintPublicKey).should.eventually - .be.rejected.and.have.property("message") - .that.includes("not listing owner"); + await validatorRegistry.confirmListing + .callAsync(tendermintPublicKey) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("not listing owner"); }); it("should require sufficient blocks to pass before confirmation", async () => { @@ -433,9 +425,10 @@ describe("ValidatorRegistry", async () => { paradigmMarket, ); const appBlock = decodeKosuEvents(result.logs)[0].applicationBlockNumber; - await validatorRegistry.confirmListing.callAsync(tendermintPublicKey).should.eventually - .be.rejected.and.have.property("message") - .that.includes("application period active"); + await validatorRegistry.confirmListing + .callAsync(tendermintPublicKey) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("application period active"); await testHelpers.skipApplicationPeriod(appBlock); @@ -469,8 +462,9 @@ describe("ValidatorRegistry", async () => { tendermintPublicKey, paradigmMarket, ).should.eventually.be.fulfilled; - await validatorRegistry.confirmListing.callAsync(tendermintPublicKey).should - .eventually.be.rejected.and.have.property("message") + await validatorRegistry.confirmListing + .callAsync(tendermintPublicKey) + .should.eventually.be.rejected.and.have.property("message") .that.includes("listing not pending"); await testHelpers.skipChallengePeriod(result.blockNumber); @@ -482,9 +476,11 @@ describe("ValidatorRegistry", async () => { }); it("should only let the listing owner confirm the listing", async () => { - await validatorRegistry.confirmListing.callAsync(tendermintPublicKey, { - from: accounts[1], - }).should.eventually.be.rejected.and.have.property("message") + await validatorRegistry.confirmListing + .callAsync(tendermintPublicKey, { + from: accounts[1], + }) + .should.eventually.be.rejected.and.have.property("message") .that.includes("not listing owner"); await validatorRegistry.confirmListing.awaitTransactionSuccessAsync(tendermintPublicKey).should .eventually.be.fulfilled; @@ -536,9 +532,10 @@ describe("ValidatorRegistry", async () => { { from: accounts[1] }, ).should.eventually.be.fulfilled; - await validatorRegistry.initExit.callAsync(tendermintPublicKey).should.eventually.be - .rejected.and.have.property("message") - .that.includes("listing not accepted"); + await validatorRegistry.initExit + .callAsync(tendermintPublicKey) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("listing not accepted"); await testHelpers.finishChallenge(tendermintPublicKey, result.blockNumber); await testHelpers.exitListing(tendermintPublicKey); @@ -549,10 +546,12 @@ describe("ValidatorRegistry", async () => { .be.fulfilled; // should only let the owner initExit - await validatorRegistry.initExit.callAsync(tendermintPublicKey, { - from: accounts[1], - }).should.eventually.be.rejected.and.have.property("message") - .that.includes("not listing owner"); + await validatorRegistry.initExit + .callAsync(tendermintPublicKey, { + from: accounts[1], + }) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("not listing owner"); const iniitalMaxRewardRate = await validatorRegistry.maxRewardRate.callAsync(); @@ -587,17 +586,20 @@ describe("ValidatorRegistry", async () => { .eventually.be.fulfilled; // should not allow a listing to exit until after the exit period - await validatorRegistry.finalizeExit.callAsync(tendermintPublicKey).should.eventually.be - .rejected.and.have.property("message") - .that.includes("exiting cool off period active"); + await validatorRegistry.finalizeExit + .callAsync(tendermintPublicKey) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("exiting cool off period active"); await testHelpers.skipExitPeriod(result.blockNumber); // should only let the owner finalizeExit - await validatorRegistry.finalizeExit.callAsync(tendermintPublicKey, { - from: accounts[1], - }).should.eventually.be.rejected.and.have.property("message") - .that.includes("not listing owner"); + await validatorRegistry.finalizeExit + .callAsync(tendermintPublicKey, { + from: accounts[1], + }) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("not listing owner"); const oldReward = await validatorRegistry.maxRewardRate.callAsync(); @@ -810,9 +812,10 @@ describe("ValidatorRegistry", async () => { }); // should require challenge to be ended - await validatorRegistry.resolveChallenge.callAsync(tendermintPublicKey).should.eventually - .be.rejected.and.have.property("message") - .that.includes("challenge has not ended"); + await validatorRegistry.resolveChallenge + .callAsync(tendermintPublicKey) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("challenge has not ended"); await testHelpers.skipChallengePeriod(blockNumber); const initialListingHolderSystemBalance = await treasury.systemBalance.callAsync(accounts[0]); @@ -824,9 +827,10 @@ describe("ValidatorRegistry", async () => { .should.eventually.be.fulfilled; // should fail if called a second time - await validatorRegistry.resolveChallenge.callAsync(tendermintPublicKey).should.eventually - .be.rejected.and.have.property("message") - .that.includes("listing is not challenged"); + await validatorRegistry.resolveChallenge + .callAsync(tendermintPublicKey) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("listing is not challenged"); const decodedLogs = decodeKosuEvents(result.logs); decodedLogs[1].eventType.should.eq("ValidatorRemoved"); @@ -1364,10 +1368,12 @@ describe("ValidatorRegistry", async () => { from: accounts[5], }); - await validatorRegistry.claimWinnings.callAsync(new BigNumber(challengeId), { - from: accounts[5], - }).should.eventually.be.rejected.and.have.property("message") - .that.includes("challenge hasn't ended"); + await validatorRegistry.claimWinnings + .callAsync(new BigNumber(challengeId), { + from: accounts[5], + }) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("challenge hasn't ended"); await testHelpers.skipChallengePeriod(blockNumber); await validatorRegistry.claimWinnings.awaitTransactionSuccessAsync(new BigNumber(challengeId), { @@ -1786,27 +1792,28 @@ describe("ValidatorRegistry", async () => { it("should not modify a negative reward", async () => { await testHelpers.prepareConfirmedListing("0xffaabb", { reward: TestValues.oneWei.times("-1") }); - await validatorRegistry.reduceReward.callAsync("0xffaabb", TestValues.zero).should - .eventually.be.rejected.and.have.property("message") - .that.includes("listing is not generating tokens"); + await validatorRegistry.reduceReward + .callAsync("0xffaabb", TestValues.zero) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("listing is not generating tokens"); await testHelpers.exitListing("0xffaabb"); }); it("should not modify a zero reward", async () => { await testHelpers.prepareConfirmedListing("0xffaabb"); - await validatorRegistry.reduceReward.callAsync("0xffaabb", TestValues.oneWei).should - .eventually.be.rejected.and.have.property("message") - .that.includes("listing is not generating tokens"); + await validatorRegistry.reduceReward + .callAsync("0xffaabb", TestValues.oneWei) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("listing is not generating tokens"); await testHelpers.exitListing("0xffaabb"); }); it("should not increase a reward", async () => { await testHelpers.prepareConfirmedListing("0xffaabb", { reward: TestValues.oneWei }); - await validatorRegistry.reduceReward.callAsync( - "0xffaabb", - TestValues.oneWei.plus(TestValues.oneWei), - ).should.eventually.be.rejected.and.have.property("message") - .that.includes("not reducing reward rate"); + await validatorRegistry.reduceReward + .callAsync("0xffaabb", TestValues.oneWei.plus(TestValues.oneWei)) + .should.eventually.be.rejected.and.have.property("message") + .that.includes("not reducing reward rate"); await testHelpers.exitListing("0xffaabb"); }); }); From cf1524b00dd6096ace1e4358b46bf0baecff341f Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Mon, 9 Sep 2019 09:56:55 -0500 Subject: [PATCH 4/9] fixing capitalization inconsistencies. --- packages/kosu-system-contracts/contracts/base/Authorizable.sol | 2 +- packages/kosu-system-contracts/contracts/lib/KosuToken.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kosu-system-contracts/contracts/base/Authorizable.sol b/packages/kosu-system-contracts/contracts/base/Authorizable.sol index 9db91670..a04333f5 100644 --- a/packages/kosu-system-contracts/contracts/base/Authorizable.sol +++ b/packages/kosu-system-contracts/contracts/base/Authorizable.sol @@ -23,7 +23,7 @@ contract Authorizable { @notice Ensures msg.sender is authorized within the AuthorizedAddresses contract */ modifier isAuthorized() { - require(authorizedAddress.isAddressAuthorized(msg.sender), "Unauthorized"); + require(authorizedAddress.isAddressAuthorized(msg.sender), "unauthorized"); _; } } diff --git a/packages/kosu-system-contracts/contracts/lib/KosuToken.sol b/packages/kosu-system-contracts/contracts/lib/KosuToken.sol index 1ccb5f44..1d27ba99 100644 --- a/packages/kosu-system-contracts/contracts/lib/KosuToken.sol +++ b/packages/kosu-system-contracts/contracts/lib/KosuToken.sol @@ -98,7 +98,7 @@ contract KosuToken is ERC20, Authorizable { */ function calculateEtherToToken(uint etherValue) internal view returns (uint) { if (_weiPaid == 0 && totalSupply() == 0) { - require(etherValue == (2 ether)/10, "First transaction must be .2 ether"); + require(etherValue == (2 ether)/10, "first transaction must be .2 ether"); return 10000 ether; } else { return Formula.calculatePurchaseReturn(totalSupply(), _weiPaid, r, etherValue); From 35ae33fdb542b689f1d0d1746fdda545f8ccf2cd Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Mon, 9 Sep 2019 17:26:39 -0500 Subject: [PATCH 5/9] Change method called. --- packages/kosu-system-contracts/test/validator_registry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kosu-system-contracts/test/validator_registry.ts b/packages/kosu-system-contracts/test/validator_registry.ts index 8503bbb1..010d1bc9 100644 --- a/packages/kosu-system-contracts/test/validator_registry.ts +++ b/packages/kosu-system-contracts/test/validator_registry.ts @@ -200,7 +200,7 @@ describe("ValidatorRegistry", async () => { .then(x => x.toString()) .should.eventually.eq("0", "currentBalance"); - await validatorRegistry.registerListing.sendTransactionAsync( + await validatorRegistry.registerListing.awaitTransactionSuccessAsync( tendermintPublicKey, minimumBalance, TestValues.zero, From 45f1b62385ae8cdf851da4b0ab76a058f8eef242 Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Mon, 9 Sep 2019 18:26:12 -0500 Subject: [PATCH 6/9] Removing old await logic --- .../src/test-helpers/index.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/kosu-system-contracts/src/test-helpers/index.ts b/packages/kosu-system-contracts/src/test-helpers/index.ts index 04a1c05c..49b46c73 100644 --- a/packages/kosu-system-contracts/src/test-helpers/index.ts +++ b/packages/kosu-system-contracts/src/test-helpers/index.ts @@ -262,20 +262,17 @@ export class TestHelpers { } public async cleanAccounts(): Promise { - const transactions = []; for (const account of this.accounts) { await this.clearTreasury(account); if (account !== this.accounts[0]) { await this.ensureTokenBalance(account, TestValues.zero); } - transactions.push( - this.migratedContracts.kosuToken.approve.awaitTransactionSuccessAsync( - this.migratedContracts.treasury.address, - TestValues.zero, - { - from: account, - }, - ), + await this.migratedContracts.kosuToken.approve.awaitTransactionSuccessAsync( + this.migratedContracts.treasury.address, + TestValues.zero, + { + from: account, + }, ); } } From ecb56a699999fc288798612a1904f0b132d58719 Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Mon, 9 Sep 2019 18:26:23 -0500 Subject: [PATCH 7/9] removing unused import. --- packages/kosu.js/test/event_emitter_test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/kosu.js/test/event_emitter_test.js b/packages/kosu.js/test/event_emitter_test.js index 68a0f195..bc7dbe58 100644 --- a/packages/kosu.js/test/event_emitter_test.js +++ b/packages/kosu.js/test/event_emitter_test.js @@ -1,5 +1,4 @@ const { EventEmitter } = require("../src/EventEmitter"); -const DeployedAddresses = require("@kosu/system-contracts").DeployedAddresses; describe("EventEmitter", () => { it("should allow constructor to configured with a custom address", async () => { From f545e7cd66f9a958da6c2e9ee659eab54fb552a8 Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Mon, 9 Sep 2019 18:26:38 -0500 Subject: [PATCH 8/9] Updating to use pay and withdraw. --- packages/kosu.js/test/event_emitter_test.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/kosu.js/test/event_emitter_test.js b/packages/kosu.js/test/event_emitter_test.js index bc7dbe58..b4aca0ff 100644 --- a/packages/kosu.js/test/event_emitter_test.js +++ b/packages/kosu.js/test/event_emitter_test.js @@ -16,16 +16,14 @@ describe("EventEmitter", () => { describe("getPastDecodedLogs", () => { it("should return decoded logs", async () => { const fromBlock = (await web3Wrapper.getBlockNumberAsync()) + 1; - await kosu.posterRegistry.registerTokens(TestValues.oneWei).catch(e => { - clearInterval(interval); - throw e; - }); + await kosu.posterRegistry.pay(TestValues.oneWei); const logs = await kosu.eventEmitter.getPastDecodedLogs({ fromBlock }); logs.length.should.eq(1); logs[0].decodedArgs.eventType.should.eq("PosterRegistryUpdate"); - await kosu.posterRegistry.releaseTokens(TestValues.oneWei); - await kosu.treasury.withdraw(TestValues.oneWei); + const tokens = await kosu.posterRegistry.tokensRegisteredFor(accounts[0]); + await kosu.posterRegistry.releaseTokens(tokens); + await kosu.treasury.withdraw(tokens); }); }); @@ -43,13 +41,14 @@ describe("EventEmitter", () => { callback, ); - await kosu.posterRegistry.registerTokens(TestValues.oneWei).catch(e => { + await kosu.posterRegistry.pay(TestValues.oneWei).catch(e => { clearInterval(interval); throw e; }); - await kosu.posterRegistry.releaseTokens(TestValues.oneWei); - await kosu.treasury.withdraw(TestValues.oneWei); + const tokens = await kosu.posterRegistry.tokensRegisteredFor(accounts[0]); + await kosu.posterRegistry.releaseTokens(tokens); + await kosu.treasury.withdraw(tokens); }) .then(() => { clearInterval(interval); From ac3479af2c674f5533dfec9adc3b0580d652df58 Mon Sep 17 00:00:00 2001 From: Nick Freyaldenhoven Date: Tue, 10 Sep 2019 08:39:12 -0500 Subject: [PATCH 9/9] Removing dependency on clone which I believe is an artifact of some of the things I tried in the past to cache build assets. Removing for attempt on getting local drone build working for debugging purposes. --- .drone.jsonnet | 6 ++---- .drone.yml | 4 ---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index c932b72c..2cb0444a 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -29,8 +29,7 @@ local KosuGeth(name) = Image(name, "kosu-test-geth:latest") { "name": "tests", "steps": [ Image("prettier_project", "node-lts:latest") { - "commands": ["yarn prettier:ci"], - "depends_on": ["clone"], + "commands": ["yarn prettier:ci"] }, Image("build-project", "node-lts:latest") + GethConfig() { @@ -40,8 +39,7 @@ local KosuGeth(name) = Image(name, "kosu-test-geth:latest") { "cd packages/kosu-system-contracts", "yarn migrate:ci", "WEB3_URI=http://go-kosu-ci-geth:8545 yarn migrate:ci" - ], - "depends_on": ["clone"] + ] }, Image("npm-tests", "node-lts:latest") + GethConfig() { diff --git a/.drone.yml b/.drone.yml index 6a18ca1c..d6cb2e6d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,8 +12,6 @@ steps: image: gcr.io/kosu-io/node-lts:latest commands: - yarn prettier:ci - depends_on: - - clone - name: build-project pull: always @@ -27,8 +25,6 @@ steps: environment: WEB3_URI: http://kosu-geth:8545 WEB3_URI_WS: ws://kosu-geth:8546 - depends_on: - - clone - name: npm-tests pull: always