Skip to content

Commit

Permalink
cmd/evm: rename b11r object clique.Authorized to clique.Authorize
Browse files Browse the repository at this point in the history
  • Loading branch information
lightclient committed Nov 19, 2021
1 parent 15048ff commit 10b9fd7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
22 changes: 11 additions & 11 deletions cmd/evm/internal/t8ntool/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ type bbInput struct {
}

type cliqueInput struct {
Key *ecdsa.PrivateKey
Voted *common.Address
Authorized *bool
Vanity common.Hash
Key *ecdsa.PrivateKey
Voted *common.Address
Authorize *bool
Vanity common.Hash
}

// UnmarshalJSON implements json.Unmarshaler interface.
func (c *cliqueInput) UnmarshalJSON(input []byte) error {
var x struct {
Key *common.Hash `json:"secretKey"`
Voted *common.Address `json:"voted"`
Authorized *bool `json:"authorized"`
Vanity common.Hash `json:"vanity"`
Key *common.Hash `json:"secretKey"`
Voted *common.Address `json:"voted"`
Authorize *bool `json:"authorize"`
Vanity common.Hash `json:"vanity"`
}
if err := json.Unmarshal(input, &x); err != nil {
return err
Expand All @@ -106,7 +106,7 @@ func (c *cliqueInput) UnmarshalJSON(input []byte) error {
c.Key = ecdsaKey
}
c.Voted = x.Voted
c.Authorized = x.Authorized
c.Authorize = x.Authorize
c.Vanity = x.Vanity
return nil
}
Expand Down Expand Up @@ -209,11 +209,11 @@ func (i *bbInput) sealClique(block *types.Block) (*types.Block, error) {
}
header.Coinbase = *i.Clique.Voted
}
if i.Clique.Authorized != nil {
if i.Clique.Authorize != nil {
if i.Header.Nonce != nil {
return nil, NewError(ErrorConfig, fmt.Errorf("sealing with clique and voting will overwrite provided nonce"))
}
if *i.Clique.Authorized {
if *i.Clique.Authorize {
header.Nonce = [8]byte{}
} else {
header.Nonce = [8]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/testdata/21/clique.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"secretKey": "0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"voted": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
"authorized": false,
"authorize": false,
"vanity": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}
6 changes: 0 additions & 6 deletions cmd/evm/testdata/22/clique.json

This file was deleted.

0 comments on commit 10b9fd7

Please sign in to comment.