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

Wrong balance and getGasPrice for custom networks #10177

Closed
helderjnpinto opened this issue Jan 12, 2021 · 8 comments
Closed

Wrong balance and getGasPrice for custom networks #10177

helderjnpinto opened this issue Jan 12, 2021 · 8 comments
Labels
area-customNetworks needs-reproduction Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug

Comments

@helderjnpinto
Copy link

Describe the bug
Wrong balance in local testnet and also getGasPrice is the not as json rpc.
referent with issue #7263 [https://github.com//issues/7263](issue 7263)

Steps to reproduce (REQUIRED)
Running Besu client with some accounts with balance, connect to local network

Expected behavior
Get right balance
Get right gas price for custom networks by using jsonrpc

Screenshots

Get Balance
image

Get gasPrice
image

Browser details (please complete the following information):

  • Ubuntu 20
  • Browser: Version 87.0.4280.141 (Official Build) (64-bit)
  • MetaMask Version: [8.1.11]
@Gudahtt
Copy link
Member

Gudahtt commented Jan 14, 2021

Thanks for the report! This is a dupliucate of #10003; I'd suggest following that issue for further updates.

@Gudahtt Gudahtt closed this as completed Jan 14, 2021
@helderjnpinto
Copy link
Author

@Gudahtt Hi this problem persists after merge of issue #10003 you can test with our Hyperledger Besu fork in public mint Here is the rpc: https://rpc.tst.publicmint.io:8545/

@helderjnpinto
Copy link
Author

image

@Gudahtt Gudahtt added needs-reproduction Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug area-customNetworks labels Mar 8, 2021
@Gudahtt
Copy link
Member

Gudahtt commented Mar 8, 2021

Thanks @helderjnpinto; I'll re-open this. The original issue reported two problems, the one we fixed was related to gas price. I'm not aware of any recent changes to how balance is queried.

Could you share additional details? In particular, it'd be great to know the network settings (Settings -> Networks -> PublicMint-TST), and also the most recent MetaMask version that you've tested with.

@Gudahtt Gudahtt reopened this Mar 8, 2021
@helderjnpinto
Copy link
Author

@Gudahtt here is the network settings:

Correct eth_getBalance

curl --location --request POST 'https://rpc.tst.publicmint.io:8545/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": [
        "0x8717eD44cEB53f15dB9CF1bEc75a037A70232AC8",
        "latest"
    ],
    "id": 1
}'
{
  "jsonrpc" : "2.0",
  "id" : 1,
  "result" : "899950000000000000000"
}%   

Explorer balance: https://explorer.tst.publicmint.io/address/0x8717eD44cEB53f15dB9CF1bEc75a037A70232AC8/transactions


@helderjnpinto
Copy link
Author

helderjnpinto commented Mar 8, 2021

@Gudahtt

But this balance is em WEI and not have convertion rate.
PublicMint treats ETH units as if it were a USD ERC20 with 18 decimal places or like normal Ethereum balance.
Just need to show ETH balance like in ethereum mainnet but with Label USD / MINT.

Also is not hex value, so resuming:

  • is not hex, is WEI units.
  • not have convertion rate

Here is the printscreen of debug in chrome.

12cbc70a0e0740d9b2f1bd219237911a

@helderjnpinto
Copy link
Author

@Gudahtt sorry for this issue i investigated more and maybe is only my fork of besu, https://besu.hyperledger.org/en/1.4.4/Reference/API-Methods/#eth_getbalance in documentation needs to respond a hex value not WEI value.

Thanks for reopening this case i will close.

@Gudahtt
Copy link
Member

Gudahtt commented Mar 9, 2021

OK, sounds good. Thanks for following up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-customNetworks needs-reproduction Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug
Projects
None yet
Development

No branches or pull requests

2 participants