-
Notifications
You must be signed in to change notification settings - Fork 1
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 GetBalance
return the sum of native & sgt balance
#24
base: op-es
Are you sure you want to change the base?
Conversation
@@ -688,8 +688,8 @@ func (api *BlockChainAPI) GetBalance(ctx context.Context, address common.Address | |||
if state == nil || err != nil { | |||
return nil, err | |||
} | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about re-using OptimismConfig.UseSoulGasToken
as the flag to enable this change?
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 .