-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add pre-commit #12
base: master
Are you sure you want to change the base?
Add pre-commit #12
Changes from all commits
eec639b
4fddade
778afb5
0c8d95c
7188a18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
repos: | ||
- repo: https://github.com/golangci/golangci-lint | ||
rev: v1.50.1 | ||
hooks: | ||
- id: golangci-lint |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// Package minipool is legacy so no linting is applied. | ||
//nolint:all | ||
package minipool | ||
|
||
import ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,28 +39,28 @@ type NodeDetails struct { | |
} | ||
|
||
// Node details | ||
type nodeDetails_Native struct { | ||
exists bool | ||
registrationTime *big.Int | ||
timezoneLocation string | ||
feeDistributorInitialised bool | ||
feeDistributorAddress common.Address | ||
rewardNetwork *big.Int | ||
rplStake *big.Int | ||
effectiveRPLStake *big.Int | ||
minimumRPLStake *big.Int | ||
maximumRPLStake *big.Int | ||
minipoolLimit *big.Int | ||
minipoolCount *big.Int | ||
balanceETH *big.Int | ||
balanceRETH *big.Int | ||
balanceRPL *big.Int | ||
balanceOldRPL *big.Int | ||
withdrawalAddress common.Address | ||
pendingWithdrawalAddress common.Address | ||
smoothingPoolRegistrationState bool | ||
smoothingPoolRegistrationChanged *big.Int | ||
} | ||
//type nodeDetails_Native struct { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is unused, but looks like active development so commented it out. |
||
// exists bool | ||
// registrationTime *big.Int | ||
// timezoneLocation string | ||
// feeDistributorInitialised bool | ||
// feeDistributorAddress common.Address | ||
// rewardNetwork *big.Int | ||
// rplStake *big.Int | ||
// effectiveRPLStake *big.Int | ||
// minimumRPLStake *big.Int | ||
// maximumRPLStake *big.Int | ||
// minipoolLimit *big.Int | ||
// minipoolCount *big.Int | ||
// balanceETH *big.Int | ||
// balanceRETH *big.Int | ||
// balanceRPL *big.Int | ||
// balanceOldRPL *big.Int | ||
// withdrawalAddress common.Address | ||
// pendingWithdrawalAddress common.Address | ||
// smoothingPoolRegistrationState bool | ||
// smoothingPoolRegistrationChanged *big.Int | ||
//} | ||
|
||
// Count of nodes belonging to a timezone | ||
type TimezoneCount struct { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -157,25 +157,6 @@ func (c *Contract) estimateGasLimit(opts *bind.TransactOpts, input []byte) (uint | |
|
||
} | ||
|
||
// Wait for a transaction to be mined and get a tx receipt | ||
func (c *Contract) getTransactionReceipt(tx *types.Transaction) (*types.Receipt, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unused method. Since no recent development on this, deleted. |
||
|
||
// Wait for transaction to be mined | ||
txReceipt, err := bind.WaitMined(context.Background(), c.Client, tx) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
// Check transaction status | ||
if txReceipt.Status == 0 { | ||
return txReceipt, errors.New("Transaction failed with status 0") | ||
} | ||
|
||
// Return | ||
return txReceipt, nil | ||
|
||
} | ||
|
||
// Get contract events from a transaction | ||
// eventPrototype must be an event struct type | ||
// Returns a slice of untyped values; assert returned events to event struct type | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ func GetAddressQueueLength(rp *rocketpool.RocketPool, opts *bind.CallOpts, key [ | |
} | ||
length := new(*big.Int) | ||
if err := addressQueueStorage.Call(opts, length, "getIndexOf", key); err != nil { | ||
return 0, fmt.Errorf("Could not get address queue length for key: %w", key, err) | ||
return 0, fmt.Errorf("Could not get address queue length for key %x: %w", key, err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chose |
||
} | ||
return (*length).Uint64(), nil | ||
} | ||
|
@@ -33,7 +33,7 @@ func GetAddressQueueItem(rp *rocketpool.RocketPool, opts *bind.CallOpts, key [32 | |
} | ||
address := new(common.Address) | ||
if err := addressQueueStorage.Call(opts, address, "getItem", key, index); err != nil { | ||
return common.Address{}, fmt.Errorf("Could not get address item at index %d: %w", index, key, err) | ||
return common.Address{}, fmt.Errorf("Could not get address item at index %d for key %x: %w", index, key, err) | ||
} | ||
return *address, nil | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,8 @@ func GetAccount(index uint8) (*Account, error) { | |
|
||
// Get a transactor for an account | ||
func (a *Account) GetTransactor() *bind.TransactOpts { | ||
opts := bind.NewKeyedTransactor(a.PrivateKey) | ||
// TODO: Update to `NewKeyedTransactorWithChainID` | ||
opts := bind.NewKeyedTransactor(a.PrivateKey) //nolint:all | ||
Comment on lines
+46
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deprecated method. Can pick up in future PR. |
||
opts.Context = context.Background() | ||
return opts | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linter flagged that this is always true