make GetBalance return the sum of native & sgt balance#24
make GetBalance return the sum of native & sgt balance#24blockchaindevsh merged 2 commits intoop-esfrom
GetBalance return the sum of native & sgt balance#24Conversation
| } | ||
| b := state.GetBalance(address).ToBig() | ||
| return (*hexutil.Big)(b), state.Error() | ||
| nativeBalance, sgtBalance := core.GetGasBalancesInBig(state, api.b.ChainConfig(), address) |
There was a problem hiding this comment.
Should we use a flag to turn it on or off? Or another idea is to use a flag with different port number for SGT balance RPC
|
Has the workaround been tested with MetaMask to confirm it works? |
Not yet, but I've shipped it to the beta testnet since it doesn't affect consensus. Could you have another try ? If not , I can do it a bit later. |
It worked on my side. However, as we discussed earlier, the side effect is that Metamask displays the SGT balance, which might confuse users when they attempt to transfer it, as the transaction will ultimately fail. |

This is a workaround for ethstorage/optimism#148 .
This PR adds another http server for SGT that will include SGT balance for the
eth_GetBalanceAPI.