Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename externalBalance to getExternalBalance #334

Merged
merged 1 commit into from
Aug 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/eei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,13 @@ namespace hera {
return Literal();
}

if (import->base == Name("getBalance")) {
if (import->base == Name("getExternalBalance")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather have things in line with existing naming schemes like RPC.
In that can, getExternal* would become get get*At which, in my opinion, makes more sense upon reading.

Copy link
Member Author

@axic axic Aug 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in line with the EEI, we've agreed that a complete proposal should be made on the EEI to change all occurences of getExternal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok the name change should probably be introduced in a later revision, as it would probably break a lot of tests for the current one.

Maybe having multiple aliases for EEI methods would be good for backwards compatibility, at the cost of clarity

heraAssert(arguments.size() == 2, string("Argument count mismatch in: ") + import->base.str);

uint32_t addressOffset = static_cast<uint32_t>(arguments[0].geti32());
uint32_t resultOffset = static_cast<uint32_t>(arguments[1].geti32());

HERA_DEBUG << "getBalance " << hex << addressOffset << " " << resultOffset << dec << "\n";
HERA_DEBUG << "getExternalBalance " << hex << addressOffset << " " << resultOffset << dec << "\n";

evmc_address address = loadUint160(addressOffset);
evmc_uint256be result;
Expand Down