Merge pull request #133 from sc-forks/truffle-4
Permit view, pure, experimental and solc 0.4.17npm-parser
commit
721fb87c53
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,17 @@ |
|||||||
|
/* eslint-env node, mocha */ |
||||||
|
/* global artifacts, contract, assert */ |
||||||
|
|
||||||
|
const PureView = artifacts.require('./PureView.sol'); |
||||||
|
|
||||||
|
contract('PureView', accounts => { |
||||||
|
|
||||||
|
it('calls a pure function', async function(){ |
||||||
|
const instance = await PureView.deployed(); |
||||||
|
const value = await instance.isPure(4,5); |
||||||
|
}); |
||||||
|
|
||||||
|
it('calls a view function', async function(){ |
||||||
|
const instance = await PureView.deployed(); |
||||||
|
const value = await instance.isView(); |
||||||
|
}) |
||||||
|
}); |
@ -0,0 +1,15 @@ |
|||||||
|
pragma experimental "v0.5.0"; |
||||||
|
|
||||||
|
contract PureView { |
||||||
|
|
||||||
|
// Make sure we aren't corrupting anything with the replace |
||||||
|
uint notpureview = 5; |
||||||
|
|
||||||
|
function isPure(uint a, uint b) pure returns (uint){ |
||||||
|
return a * b; |
||||||
|
} |
||||||
|
|
||||||
|
function isView() view returns (uint){ |
||||||
|
return notpureview; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue