Created
July 16, 2019 10:54
-
-
Save JAicewizard/0b7e3819490784eb11595c5870793e57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ( | |
ModuleFunctionID struct { | |
isContracted bool | |
moduleName string | |
functionName string | |
} | |
) | |
func (mf *ModuleFunctionID) FromBytes(data []byte) { | |
fmt.Println(string(data)) | |
if data == nil { | |
return | |
} | |
split := bytes.SplitN(data, []byte("_"), 2) | |
if len(split) == 1 { | |
mf.isContracted = true | |
mf.moduleName = string(split[0]) | |
mf.functionName = string(split[0]) | |
} else if len(split) == 2 { | |
mf.moduleName = string(split[0]) | |
mf.functionName = string(split[1]) | |
} | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment