mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
Co-authored-by: cui <cuiweixie@gmail.com>
This commit is contained in:
parent
4fd1e0b04d
commit
343cd1021a
1 changed files with 5 additions and 1 deletions
|
|
@ -33,6 +33,10 @@ import (
|
|||
"github.com/XinFinOrg/XDPoSChain/log"
|
||||
)
|
||||
|
||||
var (
|
||||
intRegex = regexp.MustCompile(`(u)?int([0-9]*)`)
|
||||
)
|
||||
|
||||
func isKeyWord(arg string) bool {
|
||||
switch arg {
|
||||
case "break":
|
||||
|
|
@ -299,7 +303,7 @@ func bindBasicType(kind abi.Type) string {
|
|||
case abi.AddressTy:
|
||||
return "common.Address"
|
||||
case abi.IntTy, abi.UintTy:
|
||||
parts := regexp.MustCompile(`(u)?int([0-9]*)`).FindStringSubmatch(kind.String())
|
||||
parts := intRegex.FindStringSubmatch(kind.String())
|
||||
switch parts[2] {
|
||||
case "8", "16", "32", "64":
|
||||
return fmt.Sprintf("%sint%s", parts[1], parts[2])
|
||||
|
|
|
|||
Loading…
Reference in a new issue