t.ok(common.getFullQuallyfiedFuncDefinitionIdent(contract,fullyQualifiedFunctionDefinition,['uint256','bool'])==='baz.getY(uint256,bool)','creates right signature')
'attributes':{
'constant':false,
'name':'getY',
'payable':false,
'visibility':'public'
},
'children':[
{
'children':[
{
'attributes':{
'name':'z',
'type':'uint256'
},
'children':[
{
'attributes':{
'name':'uint'
},
'name':'ElementaryTypeName'
}
],
'name':'VariableDeclaration'
},
{
'attributes':{
'name':'r',
'type':'bool'
},
'children':[
{
'attributes':{
'name':'bool'
},
'name':'ElementaryTypeName'
}
],
'name':'VariableDeclaration'
}
],
'name':'ParameterList'
},
{
'children':[
{
'attributes':{
'name':'',
'type':'uint256'
},
'children':[
{
'attributes':{
'name':'uint'
},
'id':34,
'name':'ElementaryTypeName',
'src':'285:4:0'
}
],
'id':35,
'name':'VariableDeclaration',
'src':'285:4:0'
}
],
'name':'ParameterList'
},
{
'children':[],
'name':'Block'
}
],
'name':'FunctionDefinition'
}
t.ok(common.getFullQuallyfiedFuncDefinitionIdent(contract,funDef,['uint256','bool'])==='baz.getY(uint256,bool)','creates right signature')
t.throws(()=>common.getFullQuallyfiedFuncDefinitionIdent(contract,{name:'MemberAccess'},['uint256','bool']),undefined,'throws on wrong nodes')
t.throws(()=>common.getFullQuallyfiedFuncDefinitionIdent(contract,{name:'MemberAccess'},['uint256','bool']),undefined,'throws on wrong nodes')
t.throws(()=>common.getFullQuallyfiedFuncDefinitionIdent({name:'FunctionCall'},funDef,['uint256','bool']),undefined,'throws on wrong nodes')
t.throws(()=>common.getFullQuallyfiedFuncDefinitionIdent({name:'FunctionCall'},fullyQualifiedFunctionDefinition,['uint256','bool']),undefined,'throws on wrong nodes')
t.ok(common.isLowLevelCallcodeInst(lowlevelCall.callcodeAst)&&common.isLowLevelCall(lowlevelCall.callcodeAst),'callcode is llc should work')
t.notOk(common.isLowLevelCallcodeInst(lowlevelCall.callAst),'call is not callcode')
t.ok(common.isLowLevelSendInst(sendAst)&&common.isLowLevelCall(sendAst),'send is llc should work')
t.ok(common.isLowLevelDelegatecallInst(lowlevelCall.delegatecallAst)&&common.isLowLevelCall(lowlevelCall.delegatecallAst),'delegatecall is llc should work')
t.ok(common.isLowLevelCallInst(callAst)&&common.isLowLevelCall(callAst),'call is llc should work')
t.notOk(common.isLowLevelCallInst(callcodeAst),'callcode is not call')
t.ok(common.isLowLevelCallcodeInst(callcodeAst)&&common.isLowLevelCall(callcodeAst),'callcode is llc should work')
t.notOk(common.isLowLevelCallcodeInst(callAst),'call is not callcode')
t.ok(common.isLowLevelDelegatecallInst(delegatecallAst)&&common.isLowLevelCall(delegatecallAst),'delegatecall is llc should work')
})
})
test('staticAnalysisCommon: Call of parameter function',function(t){
test('staticAnalysisCommon: Call of parameter function',function(t){