Commit f48bb9f6 authored by aniket-engg's avatar aniket-engg Committed by Aniket

fixed analyzer tests

parent 381b0e3b
...@@ -459,9 +459,9 @@ test('staticAnalysisCommon.isStateVariable', function (t) { ...@@ -459,9 +459,9 @@ test('staticAnalysisCommon.isStateVariable', function (t) {
test('staticAnalysisCommon.isConstantFunction', function (t) { test('staticAnalysisCommon.isConstantFunction', function (t) {
t.plan(3) t.plan(3)
var node1 = { name: 'FunctionDefinition', attributes: { constant: true } } var node1 = { name: 'FunctionDefinition', attributes: { constant: true, stateMutability: 'view' } }
var node2 = { name: 'FunctionDefinition', attributes: { constant: false } } var node2 = { name: 'FunctionDefinition', attributes: { constant: false, stateMutability: 'nonpayable' } }
var node3 = { name: 'MemberAccess', attributes: { constant: true } } var node3 = { name: 'MemberAccess', attributes: { constant: true, stateMutability: 'view' } }
t.ok(common.isConstantFunction(node1), 'should be const func definition') t.ok(common.isConstantFunction(node1), 'should be const func definition')
t.notOk(common.isConstantFunction(node2), 'should not be const func definition') t.notOk(common.isConstantFunction(node2), 'should not be const func definition')
...@@ -504,7 +504,7 @@ test('staticAnalysisCommon.isFullyImplementedContract', function (t) { ...@@ -504,7 +504,7 @@ test('staticAnalysisCommon.isFullyImplementedContract', function (t) {
test('staticAnalysisCommon.isCallToNonConstLocalFunction', function (t) { test('staticAnalysisCommon.isCallToNonConstLocalFunction', function (t) {
t.plan(2) t.plan(2)
t.ok(common.isCallToNonConstLocalFunction(localCall), 'should be call to non const Local func') 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') t.notok(common.isCallToNonConstLocalFunction(localCall), 'should no longer be call to non const Local func')
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment