parent
0b5775b7e7
commit
2ecbe5efc6
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