Remove migrations and skipped/stale tests from test suite (#840)
parent
3f767d765e
commit
1c257b0c74
@ -0,0 +1 @@ |
||||
// because circle won't copy the folder w/out contents |
@ -1,25 +0,0 @@ |
||||
pragma solidity >=0.4.22 <0.8.0; |
||||
|
||||
|
||||
contract Migrations { |
||||
address public owner; |
||||
|
||||
uint public last_completed_migration; |
||||
|
||||
modifier restricted() { |
||||
if (msg.sender == owner) { _; } |
||||
} |
||||
|
||||
constructor() public { |
||||
owner = msg.sender; |
||||
} |
||||
|
||||
function setCompleted(uint completed) public restricted { |
||||
last_completed_migration = completed; |
||||
} |
||||
|
||||
function upgrade(address new_address) public restricted { |
||||
Migrations upgraded = Migrations(new_address); |
||||
upgraded.setCompleted(last_completed_migration); |
||||
} |
||||
} |
@ -1,4 +0,0 @@ |
||||
const Migrations = artifacts.require('./Migrations.sol'); |
||||
module.exports = async function(deployer) { |
||||
await deployer.deploy(Migrations); |
||||
}; |
@ -1,5 +0,0 @@ |
||||
const Migrations = artifacts.require("Migrations"); |
||||
|
||||
module.exports = function(deployer) { |
||||
deployer.deploy(Migrations); |
||||
}; |
@ -1,8 +0,0 @@ |
||||
const UsesPure = artifacts.require("UsesPure"); |
||||
const CLibrary = artifacts.require("CLibrary"); |
||||
|
||||
module.exports = function(deployer) { |
||||
deployer.deploy(CLibrary); |
||||
deployer.link(CLibrary, UsesPure); |
||||
deployer.deploy(UsesPure); |
||||
}; |
@ -1,8 +0,0 @@ |
||||
// Testing hooks
|
||||
const fn = (msg, config) => config.logger.log(msg); |
||||
|
||||
module.exports = { |
||||
skipFiles: ['Migrations.sol'], |
||||
silent: process.env.SILENT ? true : false, |
||||
istanbulReporter: ['json-summary', 'text'], |
||||
} |
@ -1,24 +0,0 @@ |
||||
pragma solidity ^0.6.0; |
||||
|
||||
contract B_Wallet { |
||||
|
||||
event Deposit(address indexed _sender, uint _value, bytes data); |
||||
|
||||
receive() external payable |
||||
{ |
||||
if (msg.value > 0) |
||||
emit Deposit(msg.sender, msg.value, msg.data); |
||||
} |
||||
|
||||
function transferPayment(uint payment, address payable recipient) public { |
||||
recipient.transfer(payment); |
||||
} |
||||
|
||||
function sendPayment(uint payment, address payable recipient) public { |
||||
require(recipient.send(payment), 'sendPayment failed'); |
||||
} |
||||
|
||||
function getBalance() public view returns(uint){ |
||||
return address(this).balance; |
||||
} |
||||
} |
@ -1,66 +0,0 @@ |
||||
pragma solidity ^0.6.0; |
||||
|
||||
import "./ContractB.sol"; |
||||
|
||||
/** |
||||
* New syntaxes in solc 0.6.x |
||||
*/ |
||||
contract ContractA is ContractB { |
||||
uint counter; |
||||
uint errorCount; |
||||
|
||||
uint private immutable _a = 100; |
||||
uint private immutable override _b = 100; |
||||
|
||||
modifier overridden() override { |
||||
require(true); |
||||
_; |
||||
} |
||||
|
||||
constructor() public { |
||||
} |
||||
|
||||
function simpleSet(uint i) |
||||
public |
||||
override(ContractB) |
||||
{ |
||||
counter = counter + i; |
||||
} |
||||
|
||||
function simpleView(uint i) |
||||
view |
||||
overridden |
||||
external |
||||
returns (uint, bool) |
||||
{ |
||||
return (counter + i, true); |
||||
} |
||||
|
||||
function tryCatch() public returns (uint, bool) { |
||||
try this.simpleView(5) returns (uint, bool) { |
||||
return (2, true); |
||||
} catch Error(string memory) { |
||||
errorCount++; |
||||
return (0, false); |
||||
} catch (bytes memory) { |
||||
errorCount = errorCount + 1; |
||||
return (0, false); |
||||
} |
||||
} |
||||
|
||||
function arraySlice(uint _a, uint b_) public pure { |
||||
abi.decode(msg.data[4:], (uint, uint)); |
||||
} |
||||
|
||||
function payableFn() public pure { |
||||
address x; |
||||
//address y = payable(x); // parser-diligence crashing here... |
||||
} |
||||
} |
||||
|
||||
// Making sure same-file inheritance works for solc-6... |
||||
contract ContractC is ContractA { |
||||
function simpleC(uint x) public { |
||||
x++; |
||||
} |
||||
} |
@ -1,19 +0,0 @@ |
||||
pragma solidity ^0.6.0; |
||||
|
||||
|
||||
contract ContractB { |
||||
uint value; |
||||
uint b; |
||||
|
||||
constructor() public { |
||||
} |
||||
|
||||
modifier overridden() virtual { |
||||
require(true); |
||||
_; |
||||
} |
||||
|
||||
function simpleSet(uint i) public virtual { |
||||
value = 5; |
||||
} |
||||
} |
@ -1,9 +0,0 @@ |
||||
require("@nomiclabs/hardhat-truffle5"); |
||||
require(__dirname + "/../plugins/nomiclabs.plugin"); |
||||
|
||||
module.exports = { |
||||
solidity: { |
||||
version: "0.6.7" |
||||
}, |
||||
logger: process.env.SILENT ? { log: () => {} } : console, |
||||
}; |
@ -1,26 +0,0 @@ |
||||
const Wallet = artifacts.require('B_Wallet'); |
||||
|
||||
contract('B_Wallet', accounts => { |
||||
it('should should allow transfers and sends', async () => { |
||||
const walletA = await Wallet.new(); |
||||
const walletB = await Wallet.new(); |
||||
|
||||
await walletA.sendTransaction({ |
||||
value: web3.utils.toBN(500), from: accounts[0], |
||||
}); |
||||
|
||||
await walletA.sendPayment(50, walletB.address, { |
||||
from: accounts[0], |
||||
}); |
||||
|
||||
await walletA.transferPayment(50, walletB.address, { |
||||
from: accounts[0], |
||||
}); |
||||
|
||||
// Also try transferring 0, for branch hit
|
||||
await walletA.transferPayment(0, walletB.address, { |
||||
from: accounts[0], |
||||
}); |
||||
}); |
||||
}); |
||||
|
@ -1,27 +0,0 @@ |
||||
const ContractA = artifacts.require("ContractA"); |
||||
|
||||
contract("contracta", function(accounts) { |
||||
let instance; |
||||
|
||||
before(async () => instance = await ContractA.new()) |
||||
|
||||
it('simpleSet (overridden method)', async function(){ |
||||
await instance.simpleSet(5); |
||||
}); |
||||
|
||||
it('simpleView (overridden modifier)', async function(){ |
||||
await instance.simpleView(5); |
||||
}); |
||||
|
||||
it('tryCatch', async function(){ |
||||
await instance.tryCatch(); |
||||
}); |
||||
|
||||
it('arraySlice', async function(){ |
||||
await instance.arraySlice(5,7); |
||||
}); |
||||
|
||||
it('payableFn', async function(){ |
||||
await instance.payableFn(); |
||||
}) |
||||
}); |
@ -1,6 +0,0 @@ |
||||
module.exports = { |
||||
silent: process.env.SILENT ? true : false, |
||||
skipFiles: ['skipped-folder'], |
||||
istanbulReporter: ['json-summary', 'text'], |
||||
configureYulOptimizer: true |
||||
} |
@ -1,52 +0,0 @@ |
||||
pragma solidity ^0.7.4; |
||||
pragma abicoder v2; |
||||
|
||||
import { |
||||
LENDING_POOL, |
||||
CHAINLINK, |
||||
_addFive, |
||||
_addSeven |
||||
} from "./Functions_solc7.sol"; |
||||
|
||||
function _addTen(uint x) |
||||
pure |
||||
returns (uint) |
||||
{ |
||||
return x + 10; |
||||
} |
||||
|
||||
/** |
||||
* New syntaxes in solc 0.7.x |
||||
*/ |
||||
contract ContractA { |
||||
uint y = 5; |
||||
|
||||
function addFive() |
||||
public |
||||
view |
||||
returns (uint) |
||||
{ |
||||
return _addFive(y); |
||||
} |
||||
|
||||
function addSeven() |
||||
public |
||||
view |
||||
returns (uint) |
||||
{ |
||||
return _addSeven(y); |
||||
} |
||||
} |
||||
|
||||
contract ContractB { |
||||
uint y = 5; |
||||
|
||||
function addTen() |
||||
public |
||||
view |
||||
returns (uint) |
||||
{ |
||||
return _addTen(y); |
||||
} |
||||
|
||||
} |
@ -1,19 +0,0 @@ |
||||
pragma solidity ^0.7.4; |
||||
pragma experimental ABIEncoderV2; |
||||
|
||||
address constant LENDING_POOL = 0xB53C1a33016B2DC2fF3653530bfF1848a515c8c5; |
||||
address constant CHAINLINK = 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419; |
||||
|
||||
function _addFive(uint x) |
||||
pure |
||||
returns (uint) |
||||
{ |
||||
return x + 5; |
||||
} |
||||
|
||||
function _addSeven(uint x) |
||||
pure |
||||
returns (uint) |
||||
{ |
||||
return x + 7; |
||||
} |
@ -1,9 +0,0 @@ |
||||
require("@nomiclabs/hardhat-truffle5"); |
||||
require(__dirname + "/../plugins/nomiclabs.plugin"); |
||||
|
||||
module.exports = { |
||||
solidity: { |
||||
version: "0.7.6" |
||||
}, |
||||
logger: process.env.SILENT ? { log: () => {} } : console, |
||||
}; |
@ -1,23 +0,0 @@ |
||||
const ContractA = artifacts.require("ContractA"); |
||||
const ContractB = artifacts.require("ContractB"); |
||||
|
||||
contract("contracta", function(accounts) { |
||||
let a,b; |
||||
|
||||
before(async () => { |
||||
a = await ContractA.new(); |
||||
b = await ContractB.new(); |
||||
}) |
||||
|
||||
it('a:addFive', async function(){ |
||||
await a.addFive(); |
||||
}); |
||||
|
||||
it('a:addSeven', async function(){ |
||||
//await a.addSeven();
|
||||
}); |
||||
|
||||
it('b:addTen', async function(){ |
||||
await b.addTen(); |
||||
}) |
||||
}); |
@ -1,5 +0,0 @@ |
||||
const Migrations = artifacts.require("Migrations"); |
||||
|
||||
module.exports = function(deployer) { |
||||
deployer.deploy(Migrations); |
||||
}; |
@ -1,5 +0,0 @@ |
||||
const ContractA = artifacts.require("ContractA"); |
||||
|
||||
module.exports = function(deployer) { |
||||
deployer.deploy(ContractA); |
||||
}; |
@ -1,5 +0,0 @@ |
||||
const ContractB = artifacts.require("ContractB"); |
||||
|
||||
module.exports = function(deployer) { |
||||
deployer.deploy(ContractB); |
||||
}; |
@ -1,5 +0,0 @@ |
||||
const ContractC = artifacts.require("ContractC"); |
||||
|
||||
module.exports = function(deployer) { |
||||
deployer.deploy(ContractC); |
||||
}; |
Loading…
Reference in new issue