Skip to content

Commit

Permalink
remove vote instruction return value
Browse files Browse the repository at this point in the history
  • Loading branch information
neo hong committed Jul 24, 2021
1 parent 42e6972 commit 73619d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions libsolidity/analysis/GlobalContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,19 +401,17 @@ inline vector<shared_ptr<MagicVariableDeclaration const>> constructMagicVariable
}

void GlobalContext::addVoteMethod() {
// bool vote(address[] memory addresses, unit256[] tronpowerlist)
// void vote(address[] memory addresses, unit256[] tronpowerlist)
TypePointers parameterTypes;

parameterTypes.push_back(TypeProvider::array(DataLocation::Memory, TypeProvider::address()));
parameterTypes.push_back(TypeProvider::array(DataLocation::Memory, TypeProvider::uint256()));

TypePointers returnParameterTypes;
returnParameterTypes.push_back(TypeProvider::boolean());
strings parameterNames;
parameterNames.push_back("srList");
parameterNames.push_back("tronpowerList");
strings returnParameterNames;
returnParameterNames.push_back("ok");

m_magicVariables.push_back(make_shared<MagicVariableDeclaration>(magicVariableToID("vote"), "vote", TypeProvider::function(
parameterTypes,
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/codegen/ExpressionCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall)
m_context << Instruction::DUP1 << Instruction::MLOAD;
}
m_context << Instruction::NATIVEVOTE;
m_context << Instruction::DUP1 << Instruction::ISZERO;
m_context << Instruction::ISZERO;
m_context.appendConditionalRevert(true);
break;
}
Expand Down

0 comments on commit 73619d9

Please sign in to comment.