fixed analyzer tests

pull/7/head
aniket-engg 5 years ago committed by Aniket
parent 381b0e3b43
commit f48bb9f620
  1. 8
      remix-analyzer/test/analysis/staticAnalysisCommon-test.js

@ -459,9 +459,9 @@ test('staticAnalysisCommon.isStateVariable', function (t) {
test('staticAnalysisCommon.isConstantFunction', function (t) {
t.plan(3)
var node1 = { name: 'FunctionDefinition', attributes: { constant: true } }
var node2 = { name: 'FunctionDefinition', attributes: { constant: false } }
var node3 = { name: 'MemberAccess', attributes: { constant: true } }
var node1 = { name: 'FunctionDefinition', attributes: { constant: true, stateMutability: 'view' } }
var node2 = { name: 'FunctionDefinition', attributes: { constant: false, stateMutability: 'nonpayable' } }
var node3 = { name: 'MemberAccess', attributes: { constant: true, stateMutability: 'view' } }
t.ok(common.isConstantFunction(node1), 'should be const func definition')
t.notOk(common.isConstantFunction(node2), 'should not be const func definition')
@ -504,7 +504,7 @@ test('staticAnalysisCommon.isFullyImplementedContract', function (t) {
test('staticAnalysisCommon.isCallToNonConstLocalFunction', function (t) {
t.plan(2)
t.ok(common.isCallToNonConstLocalFunction(localCall), 'should be call to non const Local func')
localCall.children[0].attributes.type = 'function (struct Ballot.Voter storage pointer) constant payable (uint256)'
localCall.children[0].attributes.type = 'function (struct Ballot.Voter storage pointer) view payable (uint256)'
t.notok(common.isCallToNonConstLocalFunction(localCall), 'should no longer be call to non const Local func')
})

Loading…
Cancel
Save