Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bump version to 1.5.1 #2272

Open
wants to merge 51 commits into
base: feature/bump-version-to-1.5.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8a960a3
Merge pull request #2152 from PlatONnetwork/feature/bump-version-to-1…
benbaley Mar 13, 2024
7b7f28c
Bump github.com/docker/docker
dependabot[bot] Mar 20, 2024
6566b20
chore: remove repetitive words
wanshuangcheng Apr 8, 2024
acb7936
Merge pull request #2250 from wanshuangcheng/develop
benbaley Apr 10, 2024
ff92d02
Merge pull request #2249 from PlatONnetwork/dependabot/go_modules/git…
benbaley Apr 10, 2024
ea92b6f
chore: fix some comments
oftenoccur Apr 11, 2024
bc33e9a
Merge pull request #2252 from oftenoccur/develop
benbaley Apr 12, 2024
dbdcb2a
Bump golang.org/x/net from 0.17.0 to 0.23.0
dependabot[bot] Apr 19, 2024
c89d8e9
Merge pull request #165 from PlatONnetwork/feature/bump-version-to-1.5.0
niuxiaojie81 Apr 22, 2024
275b7e0
merge eth # 26409
benbaley Apr 25, 2024
942cf01
merge ETH # 26490
benbaley Apr 25, 2024
333b274
add miss resetting to stateObjectsDestruct
benbaley Apr 25, 2024
8c2c841
merge ETH #26472 and #26381
benbaley Apr 25, 2024
31bca8e
merge ETH#26507
benbaley Apr 25, 2024
9ed20ef
merge ETH#26504
benbaley Apr 25, 2024
86545d3
merge ETH#26518
benbaley Apr 25, 2024
c7740f4
merge ETH#26462
benbaley Apr 25, 2024
773e902
merge ETH#26523
benbaley Apr 25, 2024
2b9831f
Merge ETH#26535
benbaley Apr 25, 2024
95a8bf4
merge ETH#26474
benbaley Apr 26, 2024
25d4297
merge ETH#26474
benbaley Apr 26, 2024
c84c1ff
merge ETH#26484
benbaley Apr 26, 2024
1df5133
merge ETH#26569
benbaley Apr 28, 2024
cd0a6d9
merge ETH#26556
benbaley Apr 28, 2024
3291ebe
merge ETH#26580
benbaley Apr 28, 2024
6b55d31
merge ETH#26574
benbaley Apr 28, 2024
e87c351
merge ETH#26565
benbaley Apr 28, 2024
0f5a74e
merge ETH#2656526582
benbaley Apr 28, 2024
4706477
merge ETH#26599
benbaley Apr 28, 2024
5fe9784
merge ETH#26341
benbaley Apr 28, 2024
9b470b3
merge ETH#26614
benbaley Apr 28, 2024
c5ea345
merge ETH#26607
benbaley Apr 28, 2024
21eb0c8
merge ETH#26603 and #26568
benbaley Apr 29, 2024
4eec45f
merge ETH#26637 and #26644
benbaley Apr 30, 2024
ad7eed9
merge ETH#26517
benbaley Apr 30, 2024
dbe64f1
merge ETH#26290
benbaley Apr 30, 2024
83b4bac
merge ETH#26652
benbaley Apr 30, 2024
cf7072d
Merge ETH#28520
benbaley May 6, 2024
23b7537
merge ETH#26641
benbaley May 7, 2024
6df1aa6
fix conflict & merge ETH #26632
benbaley May 7, 2024
7daa59c
merge ETH #25199
benbaley May 7, 2024
615acac
merge ETH #26675
benbaley May 7, 2024
d266dc8
merge ETH #26603 & #26637
benbaley May 7, 2024
81b0a6c
backend关闭时没有必要关闭ntab,避免潜在的ntab为空的风险
niuxiaojie81 May 8, 2024
f899f89
Merge pull request #2264 from niuxiaojie89/feature/bump-version-to-1.5.0
benbaley May 8, 2024
8e09848
Merge pull request #2255 from PlatONnetwork/dependabot/go_modules/gol…
benbaley May 8, 2024
fb7196c
Merge pull request #2265 from PlatONnetwork/feature/bump-version-to-1…
benbaley May 8, 2024
2c89339
fix err
benbaley May 20, 2024
34f1ee1
merge develop
benbaley May 22, 2024
bf4ac22
merge #2263
benbaley May 22, 2024
2434589
pebble更新到以太坊最新代码
benbaley May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,4 @@ accounts/usbwallet @karalabe
consensus @karalabe
core/ @karalabe @holiman
eth/ @karalabe
les/ @zsfelfoldi
light/ @zsfelfoldi
mobile/ @karalabe
p2p/ @fjl @zsfelfoldi
swarm/bmt @zelig
swarm/dev @lmars
swarm/fuse @jmozah @holisticode
swarm/grafana_dashboards @nonsense
swarm/metrics @nonsense @holisticode
swarm/multihash @nolash
swarm/network/bitvector @zelig @janos @gbalint
swarm/network/priorityqueue @zelig @janos @gbalint
swarm/network/simulations @zelig
swarm/network/stream @janos @zelig @gbalint @holisticode @justelad
swarm/network/stream/intervals @janos
swarm/network/stream/testing @zelig
swarm/pot @zelig
swarm/pss @nolash @zelig @nonsense
swarm/services @zelig
swarm/state @justelad
swarm/storage/encryption @gbalint @zelig @nagydani
swarm/storage/mock @janos
swarm/storage/mru @nolash
swarm/testutil @lmars
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: geth android ios evm all test clean
.PHONY: platon evm all test clean

GOBIN = $(shell pwd)/build/bin
GO ?= latest
Expand Down
7 changes: 7 additions & 0 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,13 @@ func (fb *filterBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*t
return fb.bc.GetHeaderByHash(hash), nil
}

func (fb *filterBackend) GetBody(ctx context.Context, hash common.Hash, number rpc.BlockNumber) (*types.Body, error) {
if body := fb.bc.GetBody(hash); body != nil {
return body, nil
}
return nil, errors.New("block body not found")
}

func (fb *filterBackend) PendingBlockAndReceipts() (*types.Block, types.Receipts) {
return fb.backend.pendingBlock, fb.backend.pendingReceipts
}
Expand Down
177 changes: 5 additions & 172 deletions accounts/abi/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package bind

import (
"bytes"
"errors"
"fmt"
"go/format"
"regexp"
Expand All @@ -40,8 +39,6 @@ type Lang int

const (
LangGo Lang = iota
LangJava
LangObjC
)

func isKeyWord(arg string) bool {
Expand Down Expand Up @@ -222,10 +219,6 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
if evmABI.HasReceive() {
receive = &tmplMethod{Original: evmABI.Receive}
}
// There is no easy way to pass arbitrary java objects to the Go side.
if len(structs) > 0 && lang == LangJava {
return "", errors.New("java binding for tuple arguments is not supported yet")
}

contracts[types[i]] = &tmplContract{
Type: capitalise(types[i]),
Expand Down Expand Up @@ -299,8 +292,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
// bindType is a set of type binders that convert Solidity types to some supported
// programming language types.
var bindType = map[Lang]func(kind abi.Type, structs map[string]*tmplStruct) string{
LangGo: bindTypeGo,
LangJava: bindTypeJava,
LangGo: bindTypeGo,
}

// bindBasicTypeGo converts basic solidity types(except array, slice and tuple) to Go ones.
Expand Down Expand Up @@ -343,86 +335,10 @@ func bindTypeGo(kind abi.Type, structs map[string]*tmplStruct) string {
}
}

// bindBasicTypeJava converts basic solidity types(except array, slice and tuple) to Java ones.
func bindBasicTypeJava(kind abi.Type) string {
switch kind.T {
case abi.AddressTy:
return "Address"
case abi.IntTy, abi.UintTy:
// Note that uint and int (without digits) are also matched,
// these are size 256, and will translate to BigInt (the default).
parts := regexp.MustCompile(`(u)?int([0-9]*)`).FindStringSubmatch(kind.String())
if len(parts) != 3 {
return kind.String()
}
// All unsigned integers should be translated to BigInt since gomobile doesn't
// support them.
if parts[1] == "u" {
return "BigInt"
}

namedSize := map[string]string{
"8": "byte",
"16": "short",
"32": "int",
"64": "long",
}[parts[2]]

// default to BigInt
if namedSize == "" {
namedSize = "BigInt"
}
return namedSize
case abi.FixedBytesTy, abi.BytesTy:
return "byte[]"
case abi.BoolTy:
return "boolean"
case abi.StringTy:
return "String"
case abi.FunctionTy:
return "byte[24]"
default:
return kind.String()
}
}

// pluralizeJavaType explicitly converts multidimensional types to predefined
// types in go side.
func pluralizeJavaType(typ string) string {
switch typ {
case "boolean":
return "Bools"
case "String":
return "Strings"
case "Address":
return "Addresses"
case "byte[]":
return "Binaries"
case "BigInt":
return "BigInts"
}
return typ + "[]"
}

// bindTypeJava converts a Solidity type to a Java one. Since there is no clear mapping
// from all Solidity types to Java ones (e.g. uint17), those that cannot be exactly
// mapped will use an upscaled type (e.g. BigDecimal).
func bindTypeJava(kind abi.Type, structs map[string]*tmplStruct) string {
switch kind.T {
case abi.TupleTy:
return structs[kind.TupleRawName+kind.String()].Name
case abi.ArrayTy, abi.SliceTy:
return pluralizeJavaType(bindTypeJava(*kind.Elem, structs))
default:
return bindBasicTypeJava(kind)
}
}

// bindTopicType is a set of type binders that convert Solidity types to some
// supported programming language topic types.
var bindTopicType = map[Lang]func(kind abi.Type, structs map[string]*tmplStruct) string{
LangGo: bindTopicTypeGo,
LangJava: bindTopicTypeJava,
LangGo: bindTopicTypeGo,
}

// bindTopicTypeGo converts a Solidity topic type to a Go one. It is almost the same
Expand All @@ -442,28 +358,10 @@ func bindTopicTypeGo(kind abi.Type, structs map[string]*tmplStruct) string {
return bound
}

// bindTopicTypeJava converts a Solidity topic type to a Java one. It is almost the same
// functionality as for simple types, but dynamic types get converted to hashes.
func bindTopicTypeJava(kind abi.Type, structs map[string]*tmplStruct) string {
bound := bindTypeJava(kind, structs)

// todo(rjl493456442) according solidity documentation, indexed event
// parameters that are not value types i.e. arrays and structs are not
// stored directly but instead a keccak256-hash of an encoding is stored.
//
// We only convert strings and bytes to hash, still need to deal with
// array(both fixed-size and dynamic-size) and struct.
if bound == "String" || bound == "byte[]" {
bound = "Hash"
}
return bound
}

// bindStructType is a set of type binders that convert Solidity tuple types to some supported
// programming language struct definition.
var bindStructType = map[Lang]func(kind abi.Type, structs map[string]*tmplStruct) string{
LangGo: bindStructTypeGo,
LangJava: bindStructTypeJava,
LangGo: bindStructTypeGo,
}

// bindStructTypeGo converts a Solidity tuple type to a Go one and records the mapping
Expand Down Expand Up @@ -512,74 +410,10 @@ func bindStructTypeGo(kind abi.Type, structs map[string]*tmplStruct) string {
}
}

// bindStructTypeJava converts a Solidity tuple type to a Java one and records the mapping
// in the given map.
// Notably, this function will resolve and record nested struct recursively.
func bindStructTypeJava(kind abi.Type, structs map[string]*tmplStruct) string {
switch kind.T {
case abi.TupleTy:
// We compose a raw struct name and a canonical parameter expression
// together here. The reason is before solidity v0.5.11, kind.TupleRawName
// is empty, so we use canonical parameter expression to distinguish
// different struct definition. From the consideration of backward
// compatibility, we concat these two together so that if kind.TupleRawName
// is not empty, it can have unique id.
id := kind.TupleRawName + kind.String()
if s, exist := structs[id]; exist {
return s.Name
}
var fields []*tmplField
for i, elem := range kind.TupleElems {
field := bindStructTypeJava(*elem, structs)
fields = append(fields, &tmplField{Type: field, Name: decapitalise(kind.TupleRawNames[i]), SolKind: *elem})
}
name := kind.TupleRawName
if name == "" {
name = fmt.Sprintf("Class%d", len(structs))
}
structs[id] = &tmplStruct{
Name: name,
Fields: fields,
}
return name
case abi.ArrayTy, abi.SliceTy:
return pluralizeJavaType(bindStructTypeJava(*kind.Elem, structs))
default:
return bindBasicTypeJava(kind)
}
}

// namedType is a set of functions that transform language specific types to
// named versions that may be used inside method names.
var namedType = map[Lang]func(string, abi.Type) string{
LangGo: func(string, abi.Type) string { panic("this shouldn't be needed") },
LangJava: namedTypeJava,
}

// namedTypeJava converts some primitive data types to named variants that can
// be used as parts of method names.
func namedTypeJava(javaKind string, solKind abi.Type) string {
switch javaKind {
case "byte[]":
return "Binary"
case "boolean":
return "Bool"
default:
parts := regexp.MustCompile(`(u)?int([0-9]*)(\[[0-9]*\])?`).FindStringSubmatch(solKind.String())
if len(parts) != 4 {
return javaKind
}
switch parts[2] {
case "8", "16", "32", "64":
if parts[3] == "" {
return capitalise(fmt.Sprintf("%sint%s", parts[1], parts[2]))
}
return capitalise(fmt.Sprintf("%sint%ss", parts[1], parts[2]))

default:
return javaKind
}
}
LangGo: func(string, abi.Type) string { panic("this shouldn't be needed") },
}

// alias returns an alias of the given string based on the aliasing rules
Expand All @@ -594,8 +428,7 @@ func alias(aliases map[string]string, n string) string {
// methodNormalizer is a name transformer that modifies Solidity method names to
// conform to target language naming conventions.
var methodNormalizer = map[Lang]func(string) string{
LangGo: abi.ToCamelCase,
LangJava: decapitalise,
LangGo: abi.ToCamelCase,
}

// capitalise makes a camel-case string which starts with an upper case character.
Expand Down
406 changes: 0 additions & 406 deletions accounts/abi/bind/bind_test.go

Large diffs are not rendered by default.

Loading