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

Make fee format be unified. #1069

Closed
superboyiii opened this issue Aug 26, 2019 · 13 comments · Fixed by #1071
Closed

Make fee format be unified. #1069

superboyiii opened this issue Aug 26, 2019 · 13 comments · Fixed by #1071

Comments

@superboyiii
Copy link
Member

In getblocksysfee, fee returns full decimals. However, in getrawtransaction, fee has decimal point. I think it's necessary to make fee format be unified in RPC, otherwise, it'll make a lot of users be comfused.
image
image

@erikzhang
Copy link
Member

Can you find all APIs that return inconsistent formats?

@erikzhang
Copy link
Member

And which one do you prefer to return? Long or decimal?

@shargon
Copy link
Member

shargon commented Aug 26, 2019

I prefer as decimal

@superboyiii
Copy link
Member Author

Can you find all APIs that return inconsistent formats?

Sure.

@superboyiii
Copy link
Member Author

@erikzhang
getnep5balances--->amount(full decimals)
getnep5transfers--->amount(full decimals)
getunclaimedgas--->result(full decimals)
getapplicationlog--->value(full decimals)
getbalance--->balance(full decimals)
getblock--->net_fee,sys_fee(decimal point)
getrawtransaction--->net_fee,sys_fee(decimal point)
invokefunction, invokescript--->gas_consumed, value(full decimals)
sendfrom, sendtoaddress, sendmany--->net_fee,sys_fee(decimal point)
getblocksysfee --->result(full decimals)
cli command line: decimal point
If we choose full decimals, I think we‘d better add subscript to help read value.

@erikzhang
Copy link
Member

erikzhang commented Aug 26, 2019

I prefer to return long in RPC, and return decimal in command line.

Because in RPC, the results are for programs, and long is easy for programs to process. In command line, the results are for human reading.

What do you think?

@igormcoelho
Copy link
Contributor

igormcoelho commented Aug 26, 2019

Because in RPC, the results are for programs, and long is easy for programs to process. In command line, the results are for human reading.

Couldn't agree more Erik. long is good for me too on RPC.

@shargon
Copy link
Member

shargon commented Aug 26, 2019

have sense, is good for me

@erikzhang erikzhang transferred this issue from neo-project/neo-modules Aug 28, 2019
@erikzhang
Copy link
Member

getapplicationlog--->value(full decimals)

invokefunction, invokescript--->gas_consumed, value(full decimals)

What value? I didn't see it.

@erikzhang
Copy link
Member

@superboyiii Please check the fixes.

@superboyiii
Copy link
Member Author

@erikzhang OK

@superboyiii
Copy link
Member Author

getapplicationlog--->value(full decimals)

invokefunction, invokescript--->gas_consumed, value(full decimals)

What value? I didn't see it.

I mean the invocation return value. Such like this:
image

@erikzhang
Copy link
Member

These are StackItems and I don't think they have any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants