(asset string, from, to common.Address)
| 290 | } |
| 291 | |
| 292 | func GetAllowance(asset string, from, to common.Address) (string, error) { |
| 293 | var contractAddr common.Address |
| 294 | switch strings.ToLower(asset) { |
| 295 | case "gas": |
| 296 | contractAddr = utils.GasContractAddress |
| 297 | default: |
| 298 | return "", fmt.Errorf("unsupport asset") |
| 299 | } |
| 300 | allowance, err := GetContractAllowance(0, contractAddr, from, to) |
| 301 | if err != nil { |
| 302 | return "", fmt.Errorf("get allowance error:%s", err) |
| 303 | } |
| 304 | return fmt.Sprintf("%v", allowance), nil |
| 305 | } |
| 306 | |
| 307 | func GetContractBalance(cVersion byte, contractAddres []common.Address, accAddr common.Address, atomic bool) ([]uint64, uint32, error) { |
| 308 | txes := make([]*types.Transaction, 0, len(contractAddres)) |
nothing calls this directly
no test coverage detected