MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetBalance

Function GetBalance

http/base/common/common.go:281–290  ·  view source on GitHub ↗
(address common.Address)

Source from the content-addressed store, hash-verified

279}
280
281func GetBalance(address common.Address) (*BalanceOfRsp, error) {
282 balances, height, err := GetContractBalance(0, []common.Address{utils.GasContractAddress}, address, true)
283 if err != nil {
284 return nil, fmt.Errorf("get balance error:%s", err)
285 }
286 return &BalanceOfRsp{
287 Gas: fmt.Sprintf("%d", balances[0]),
288 Height: fmt.Sprintf("%d", height),
289 }, nil
290}
291
292func GetAllowance(asset string, from, to common.Address) (string, error) {
293 var contractAddr common.Address

Callers

nothing calls this directly

Calls 2

GetContractBalanceFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected