Skip to content

Commit

Permalink
Merge pull request #1536 from celo-org/hbandura/merge-upstream-1.9.16
Browse files Browse the repository at this point in the history
Upstream merge up to 1.9.16
  • Loading branch information
hbandura authored Jun 2, 2021
2 parents 74b21c4 + 494ffce commit dc28d8b
Show file tree
Hide file tree
Showing 140 changed files with 4,229 additions and 1,336 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,16 @@ you'd expect.

HTTP based JSON-RPC API options:

* `--rpc` Enable the HTTP-RPC server
* `--rpcaddr` HTTP-RPC server listening interface (default: `localhost`)
* `--rpcport` HTTP-RPC server listening port (default: `8545`)
* `--rpcapi` API's offered over the HTTP-RPC interface (default: `eth,net,web3`)
* `--rpccorsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced)
* `--http` Enable the HTTP-RPC server
* `--http.addr` HTTP-RPC server listening interface (default: `localhost`)
* `--http.port` HTTP-RPC server listening port (default: `8545`)
* `--http.api` API's offered over the HTTP-RPC interface (default: `eth,net,web3`)
* `--http.corsdomain` Comma separated list of domains from which to accept cross origin requests (browser enforced)
* `--ws` Enable the WS-RPC server
* `--wsaddr` WS-RPC server listening interface (default: `localhost`)
* `--wsport` WS-RPC server listening port (default: `8546`)
* `--wsapi` API's offered over the WS-RPC interface (default: `eth,net,web3`)
* `--wsorigins` Origins from which to accept websockets requests
* `--ws.addr` WS-RPC server listening interface (default: `localhost`)
* `--ws.port` WS-RPC server listening port (default: `8546`)
* `--ws.api` API's offered over the WS-RPC interface (default: `eth,net,web3`)
* `--ws.origins` Origins from which to accept websockets requests
* `--ipcdisable` Disable the IPC-RPC server
* `--ipcapi` API's offered over the IPC-RPC interface (default: `admin,debug,eth,miner,net,personal,shh,txpool,web3`)
* `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it)
Expand Down
14 changes: 7 additions & 7 deletions accounts/abi/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ func formatSliceString(kind reflect.Kind, sliceSize int) string {
// type in t.
func sliceTypeCheck(t Type, val reflect.Value) error {
if val.Kind() != reflect.Slice && val.Kind() != reflect.Array {
return typeErr(formatSliceString(t.getType().Kind(), t.Size), val.Type())
return typeErr(formatSliceString(t.GetType().Kind(), t.Size), val.Type())
}

if t.T == ArrayTy && val.Len() != t.Size {
return typeErr(formatSliceString(t.Elem.getType().Kind(), t.Size), formatSliceString(val.Type().Elem().Kind(), val.Len()))
return typeErr(formatSliceString(t.Elem.GetType().Kind(), t.Size), formatSliceString(val.Type().Elem().Kind(), val.Len()))
}

if t.Elem.T == SliceTy || t.Elem.T == ArrayTy {
Expand All @@ -52,8 +52,8 @@ func sliceTypeCheck(t Type, val reflect.Value) error {
}
}

if elemKind := val.Type().Elem().Kind(); elemKind != t.Elem.getType().Kind() {
return typeErr(formatSliceString(t.Elem.getType().Kind(), t.Size), val.Type())
if elemKind := val.Type().Elem().Kind(); elemKind != t.Elem.GetType().Kind() {
return typeErr(formatSliceString(t.Elem.GetType().Kind(), t.Size), val.Type())
}
return nil
}
Expand All @@ -66,10 +66,10 @@ func typeCheck(t Type, value reflect.Value) error {
}

// Check base type validity. Element types will be checked later on.
if t.getType().Kind() != value.Kind() {
return typeErr(t.getType().Kind(), value.Kind())
if t.GetType().Kind() != value.Kind() {
return typeErr(t.GetType().Kind(), value.Kind())
} else if t.T == FixedBytesTy && t.Size != value.Len() {
return typeErr(t.getType(), value.Type())
return typeErr(t.GetType(), value.Type())
} else {
return nil
}
Expand Down
9 changes: 5 additions & 4 deletions accounts/abi/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
overloadedNames[fieldName] = fieldName
fields = append(fields, reflect.StructField{
Name: fieldName, // reflect.StructOf will panic for any exported field.
Type: cType.getType(),
Type: cType.GetType(),
Tag: reflect.StructTag("json:\"" + c.Name + "\""),
})
elems = append(elems, &cType)
Expand Down Expand Up @@ -214,7 +214,8 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
return
}

func (t Type) getType() reflect.Type {
// GetType returns the reflection type of the ABI type.
func (t Type) GetType() reflect.Type {
switch t.T {
case IntTy:
return reflectIntType(false, t.Size)
Expand All @@ -225,9 +226,9 @@ func (t Type) getType() reflect.Type {
case StringTy:
return reflect.TypeOf("")
case SliceTy:
return reflect.SliceOf(t.Elem.getType())
return reflect.SliceOf(t.Elem.GetType())
case ArrayTy:
return reflect.ArrayOf(t.Size, t.Elem.getType())
return reflect.ArrayOf(t.Size, t.Elem.GetType())
case TupleTy:
return t.TupleType
case AddressTy:
Expand Down
8 changes: 4 additions & 4 deletions accounts/abi/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func ReadFixedBytes(t Type, word []byte) (interface{}, error) {
return nil, fmt.Errorf("abi: invalid type in call to make fixed byte array")
}
// convert
array := reflect.New(t.getType()).Elem()
array := reflect.New(t.GetType()).Elem()

reflect.Copy(array, reflect.ValueOf(word[0:t.Size]))
return array.Interface(), nil
Expand All @@ -131,10 +131,10 @@ func forEachUnpack(t Type, output []byte, start, size int) (interface{}, error)

if t.T == SliceTy {
// declare our slice
refSlice = reflect.MakeSlice(t.getType(), size, size)
refSlice = reflect.MakeSlice(t.GetType(), size, size)
} else if t.T == ArrayTy {
// declare our array
refSlice = reflect.New(t.getType()).Elem()
refSlice = reflect.New(t.GetType()).Elem()
} else {
return nil, fmt.Errorf("abi: invalid type in array/slice unpacking stage")
}
Expand All @@ -158,7 +158,7 @@ func forEachUnpack(t Type, output []byte, start, size int) (interface{}, error)
}

func forTupleUnpack(t Type, output []byte) (interface{}, error) {
retval := reflect.New(t.getType()).Elem()
retval := reflect.New(t.GetType()).Elem()
virtualArgs := 0
for index, elem := range t.TupleElems {
marshalledValue, err := toGoType((index+virtualArgs)*32, *elem, output)
Expand Down
9 changes: 7 additions & 2 deletions accounts/external/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"github.com/celo-org/celo-blockchain/core/types"
blscrypto "github.com/celo-org/celo-blockchain/crypto/bls"
"github.com/celo-org/celo-blockchain/event"
"github.com/celo-org/celo-blockchain/internal/ethapi"
"github.com/celo-org/celo-blockchain/log"
"github.com/celo-org/celo-blockchain/rpc"
"github.com/celo-org/celo-blockchain/signer/core"
Expand Down Expand Up @@ -196,8 +195,13 @@ func (api *ExternalSigner) SignText(account accounts.Account, text []byte) ([]by
return signature, nil
}

// signTransactionResult represents the signinig result returned by clef.
type signTransactionResult struct {
Raw hexutil.Bytes `json:"raw"`
Tx *types.Transaction `json:"tx"`
}

func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
res := ethapi.SignTransactionResult{}
data := hexutil.Bytes(tx.Data())
var to *common.MixedcaseAddress
if tx.To() != nil {
Expand All @@ -213,6 +217,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
To: to,
From: common.NewMixedcaseAddress(account.Address),
}
var res signTransactionResult
if err := api.client.Call(&res, "account_signTransaction", args); err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (

// ErrAccountAlreadyExists is returned if an account attempted to import is
// already present in the keystore.
ErrAccountAlreadyExists = errors.New("account alreaady exists")
ErrAccountAlreadyExists = errors.New("account already exists")
)

// KeyStoreType is the reflect type of a keystore backend.
Expand Down
3 changes: 3 additions & 0 deletions build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,8 @@ func doPurge(cmdline []string) {
if err != nil {
log.Fatal(err)
}
fmt.Printf("Found %d blobs\n", len(blobs))

// Iterate over the blobs, collect and sort all unstable builds
for i := 0; i < len(blobs); i++ {
if !strings.Contains(blobs[i].Name, "unstable") {
Expand All @@ -1236,6 +1238,7 @@ func doPurge(cmdline []string) {
break
}
}
fmt.Printf("Deleting %d blobs\n", len(blobs))
// Delete all marked as such and return
if err := build.AzureBlobstoreDelete(auth, blobs); err != nil {
log.Fatal(err)
Expand Down
Loading

0 comments on commit dc28d8b

Please sign in to comment.