Make default function payable
This commit is contained in:
@ -22,7 +22,7 @@ contract SimpleTokenBounty is PullPayment {
|
||||
address public factoryAddress;
|
||||
mapping(address => address) public researchers;
|
||||
|
||||
function() {
|
||||
function() payable {
|
||||
if (claimed) throw;
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
contract('Bounty', function(accounts) {
|
||||
before(function(){
|
||||
owner = accounts[0];
|
||||
researcher = accounts[1];
|
||||
})
|
||||
|
||||
it("can create bounty contract with factory address", function(done){
|
||||
var target = SecureTargetMock.deployed();
|
||||
|
||||
SimpleTokenBounty.new(target.address).
|
||||
then(function(bounty){
|
||||
return bounty.factoryAddress.call()
|
||||
@ -12,6 +16,22 @@ contract('Bounty', function(accounts) {
|
||||
then(done);
|
||||
})
|
||||
|
||||
it("sets reward", function(done){
|
||||
var target = SecureTargetMock.deployed();
|
||||
var reward = web3.toWei(1, "ether");
|
||||
var bounty;
|
||||
SimpleTokenBounty.new(target.address).
|
||||
then(function(bounty){
|
||||
web3.eth.sendTransaction({
|
||||
from:owner,
|
||||
to:bounty.address,
|
||||
value: reward
|
||||
})
|
||||
assert.equal(reward, web3.eth.getBalance(bounty.address).toNumber())
|
||||
}).
|
||||
then(done);
|
||||
})
|
||||
|
||||
describe("SecureTargetMock", function(){
|
||||
before(function(){
|
||||
targetFactory = SecureTargetFactory.deployed();
|
||||
|
||||
Reference in New Issue
Block a user