Skip to content

Commit

Permalink
Merge branch 'ggwpez-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmota committed Jun 26, 2021
2 parents 8dd49aa + 6cacce8 commit 09fbe23
Show file tree
Hide file tree
Showing 456 changed files with 16,377 additions and 255,447 deletions.
12 changes: 2 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,9 @@ go 1.12

require (
github.com/allegro/bigcache v1.2.1 // indirect
github.com/aristanetworks/goarista v0.0.0-20190912214011-b54698eaaca6 // indirect
github.com/btcsuite/btcd v0.21.0-beta
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/davecgh/go-spew v1.1.1
github.com/elastic/gosigar v0.10.5 // indirect
github.com/ethereum/go-ethereum v1.9.5
github.com/pkg/errors v0.8.1 // indirect
github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 // indirect
github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 // indirect
github.com/syndtr/goleveldb v0.0.0-20180621010148-0d5a0ceb10cf // indirect
github.com/tyler-smith/go-bip39 v0.0.0-20180618194314-52158e4697b8
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect
golang.org/x/net v0.0.0-20190921015927-1a5e07d1ff72 // indirect
github.com/ethereum/go-ethereum v1.10.4
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef
)
532 changes: 444 additions & 88 deletions go.sum

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions hdwallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func (w *Wallet) SignHash(account accounts.Account, hash []byte) ([]byte, error)
}

// SignTxEIP155 implements accounts.Wallet, which allows the account to sign an ERC-20 transaction.
func (w *Wallet) SignTxEIP155(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
func (w *Wallet) SignTxEIP155(account accounts.Account, tx *types.Transaction, baseFee, chainID *big.Int) (*types.Transaction, error) {
w.stateLock.RLock() // Comms have own mutex, this is for the state fields
defer w.stateLock.RUnlock()

Expand All @@ -251,7 +251,7 @@ func (w *Wallet) SignTxEIP155(account accounts.Account, tx *types.Transaction, c
return nil, err
}

msg, err := signedTx.AsMessage(types.NewEIP155Signer(chainID))
msg, err := signedTx.AsMessage(types.NewEIP155Signer(chainID), baseFee)
if err != nil {
return nil, err
}
Expand All @@ -265,7 +265,7 @@ func (w *Wallet) SignTxEIP155(account accounts.Account, tx *types.Transaction, c
}

// SignTx implements accounts.Wallet, which allows the account to sign an Ethereum transaction.
func (w *Wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
func (w *Wallet) SignTx(account accounts.Account, tx *types.Transaction, baseFee, chainID *big.Int) (*types.Transaction, error) {
w.stateLock.RLock() // Comms have own mutex, this is for the state fields
defer w.stateLock.RUnlock()

Expand All @@ -286,7 +286,7 @@ func (w *Wallet) SignTx(account accounts.Account, tx *types.Transaction, chainID
return nil, err
}

msg, err := signedTx.AsMessage(types.HomesteadSigner{})
msg, err := signedTx.AsMessage(types.HomesteadSigner{}, baseFee)
if err != nil {
return nil, err
}
Expand All @@ -308,8 +308,8 @@ func (w *Wallet) SignHashWithPassphrase(account accounts.Account, passphrase str

// SignTxWithPassphrase implements accounts.Wallet, attempting to sign the given
// transaction with the given account using passphrase as extra authentication.
func (w *Wallet) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
return w.SignTx(account, tx, chainID)
func (w *Wallet) SignTxWithPassphrase(account accounts.Account, passphrase string, tx *types.Transaction, baseFee, chainID *big.Int) (*types.Transaction, error) {
return w.SignTx(account, tx, baseFee, chainID)
}

// PrivateKey returns the ECDSA private key of the account.
Expand Down
6 changes: 3 additions & 3 deletions hdwallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestWallet(t *testing.T) {

tx := types.NewTransaction(nonce, toAddress, value, gasLimit, gasPrice, data)

signedTx, err := wallet.SignTx(account, tx, nil)
signedTx, err := wallet.SignTx(account, tx, nil, nil)
if err != nil {
t.Error(err)
}
Expand All @@ -179,15 +179,15 @@ func TestWallet(t *testing.T) {
t.Error("expected s value")
}

signedTx2, err := wallet.SignTxWithPassphrase(account, "", tx, nil)
signedTx2, err := wallet.SignTxWithPassphrase(account, "", tx, nil, nil)
if err != nil {
t.Error(err)
}
if signedTx.Hash() != signedTx2.Hash() {
t.Error("expected match")
}

signedTx3, err := wallet.SignTxEIP155(account, tx, big.NewInt(42))
signedTx3, err := wallet.SignTxEIP155(account, tx, big.NewInt(41), big.NewInt(42))
if err != nil {
t.Error(err)
}
Expand Down
10 changes: 0 additions & 10 deletions vendor/github.com/allegro/bigcache/.gitignore

This file was deleted.

31 changes: 0 additions & 31 deletions vendor/github.com/allegro/bigcache/.travis.yml

This file was deleted.

201 changes: 0 additions & 201 deletions vendor/github.com/allegro/bigcache/LICENSE

This file was deleted.

Loading

0 comments on commit 09fbe23

Please sign in to comment.