Skip to content

Commit

Permalink
Merge pull request #2539 from nspcc-dev/rollback-methods-sorting
Browse files Browse the repository at this point in the history
core: sort native methods in ASCII-compatible way
  • Loading branch information
roman-khimov authored Jun 14, 2022
2 parents 6e47585 + 7612ad1 commit 5108d1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/core/interop/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (c *ContractMD) AddMethod(md *MethodAndPrice, desc *manifest.Method) {
index := sort.Search(len(c.Manifest.ABI.Methods), func(i int) bool {
md := c.Manifest.ABI.Methods[i]
if md.Name != desc.Name {
return strings.ToLower(md.Name) >= strings.ToLower(desc.Name)
return md.Name >= desc.Name
}
return len(md.Parameters) > len(desc.Parameters)
})
Expand Down Expand Up @@ -239,7 +239,7 @@ func (c *ContractMD) GetMethodByOffset(offset int) (MethodAndPrice, bool) {
func (c *ContractMD) GetMethod(name string, paramCount int) (MethodAndPrice, bool) {
index := sort.Search(len(c.Methods), func(i int) bool {
md := c.Methods[i]
res := strings.Compare(strings.ToLower(name), strings.ToLower(md.MD.Name))
res := strings.Compare(name, md.MD.Name)
switch res {
case -1, 1:
return res == -1
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const (
nfsoContractHash = "c7ec8e0fb4d669913e4ffdd4ba4fa3502e5d2d10"
nfsoToken1ID = "7e244ffd6aa85fb1579d2ed22e9b761ab62e3486"
invokescriptContractAVM = "VwIADBQBDAMOBQYMDQIODw0DDgcJAAAAAErZMCQE2zBwaEH4J+yMqiYEEUAMFA0PAwIJAAIBAwcDBAUCAQAOBgwJStkwJATbMHFpQfgn7IyqJgQSQBNA"
block20StateRootLE = "3cba730383c4c2c34475939a4efe9de9ac377bffaf0abdb6f8a1a8fe145d8f69"
block20StateRootLE = "af7fad57fc622305b162c4440295964168a07967d07244964e4ed0121b247dee"
)

var (
Expand Down

0 comments on commit 5108d1c

Please sign in to comment.