Skip to content

Commit

Permalink
fix warnings & re-eenable golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed May 28, 2024
1 parent c95afdf commit f4739fc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/_shared-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
run: staticcheck ./...


#- name: Run golangci-lint
# uses: golangci/golangci-lint-action@v3
# with:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
# version: v1.56.1
version: v1.56.1

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
8 changes: 8 additions & 0 deletions pkg/coordinator/helper/bigint.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ func (b *BigInt) UnmarshalJSON(p []byte) error {
if string(p) == "null" {
return nil
}

var z big.Int

_, ok := z.SetString(string(p), 10)
if !ok {
return fmt.Errorf("not a valid big integer: %s", p)
}

b.Value = z

return nil
}

Expand All @@ -37,12 +41,16 @@ func (b *BigInt) UnmarshalYAML(unmarshal func(interface{}) error) error {
if value == "null" {
return nil
}

var z big.Int

_, ok := z.SetString(value, 10)
if !ok {
return fmt.Errorf("not a valid big integer: %s", &b.Value)
}

b.Value = z

return nil
}

Expand Down
8 changes: 5 additions & 3 deletions pkg/coordinator/tasks/generate_deposits/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,19 @@ func (t *Task) generateDeposit(ctx context.Context, accountIdx uint64, onConfirm
}

var pub common.BLSPubkey

var withdrCreds []byte

copy(pub[:], validatorPubkey)

if t.config.WithdrawalCredentials == "" {
withdrPrivkey, err := util.PrivateKeyFromSeedAndPath(t.valkeySeed, withdrAccPath)
if err != nil {
return nil, nil, fmt.Errorf("failed generating key %v: %w", withdrAccPath, err)
withdrPrivkey, err2 := util.PrivateKeyFromSeedAndPath(t.valkeySeed, withdrAccPath)
if err2 != nil {
return nil, nil, fmt.Errorf("failed generating key %v: %w", withdrAccPath, err2)
}

var withdrPub common.BLSPubkey

copy(withdrPub[:], withdrPrivkey.PublicKey().Marshal())

withdrCreds = withdrPub[:]
Expand Down

0 comments on commit f4739fc

Please sign in to comment.