From b2c3e1e787d345920103c7bb23beeb6eeea733de Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Mon, 29 Apr 2024 17:22:22 -0500 Subject: [PATCH] Run gofumpt --- api/v1/attesterduty_test.go | 2 +- api/v1/beaconblockheader_test.go | 2 +- api/v1/beaconcommittee_test.go | 2 +- api/v1/beaconcommitteesubscription_test.go | 2 +- api/v1/blockevent_test.go | 2 +- api/v1/capella/blindedbeaconblock_test.go | 2 +- api/v1/capella/signedblindedbeaconblock_test.go | 2 +- api/v1/chainreorgevent_test.go | 2 +- api/v1/depositcontract_test.go | 2 +- api/v1/electra/blindedbeaconblockbody.go | 1 + api/v1/electra/blindedbeaconblockbody_json.go | 3 ++- api/v1/electra/blindedbeaconblockbody_yaml.go | 1 + api/v1/electra/blockcontents.go | 1 + api/v1/electra/blockcontents_json.go | 1 + api/v1/electra/blockcontents_yaml.go | 1 + api/v1/electra/signedblockcontents.go | 1 + api/v1/electra/signedblockcontents_json.go | 1 + api/v1/electra/signedblockcontents_yaml.go | 1 + api/v1/event_test.go | 2 +- api/v1/finality_test.go | 2 +- api/v1/finalizedcheckpointevent_test.go | 2 +- api/v1/genesis_test.go | 2 +- api/v1/headevent_test.go | 2 +- api/v1/payloadattributesevent.go | 3 ++- api/v1/proposalpreparation_test.go | 2 +- api/v1/proposerduty_test.go | 2 +- api/v1/signedvalidatorregistration_test.go | 2 +- api/v1/synccommittee_test.go | 2 +- api/v1/synccommitteeduty_test.go | 2 +- api/v1/synccommitteesubscription_test.go | 2 +- api/v1/syncstate_test.go | 2 +- api/v1/validator_test.go | 2 +- api/v1/validatorbalance_test.go | 2 +- api/v1/validatorregistration_test.go | 2 +- api/v1/validatorstate_test.go | 2 +- api/versionedproposal.go | 3 ++- api/versionedsignedproposal.go | 3 ++- http/beaconstate.go | 1 + http/blindedproposal.go | 1 + http/proposal.go | 3 ++- http/signedbeaconblock.go | 1 + http/submitattesterslashing_test.go | 11 ++++++----- http/submitproposalslashing_test.go | 11 ++++++----- spec/capella/historicalsummary_json_test.go | 2 +- spec/capella/historicalsummary_yaml_test.go | 2 +- spec/electra/attestation.go | 3 ++- spec/electra/beaconblockbody.go | 1 + spec/electra/beaconblockbody_json.go | 1 + spec/electra/beaconblockbody_yaml.go | 1 + spec/electra/beaconstate.go | 1 + spec/electra/beaconstate_yaml.go | 1 + spec/electra/consolidation.go | 1 + spec/electra/consolidation_json.go | 1 + spec/electra/consolidation_yaml.go | 1 + spec/electra/depositreceipt.go | 1 + spec/electra/depositreceipt_json.go | 5 +++-- spec/electra/depositreceipt_yaml.go | 1 + spec/electra/executionlayerwithdrawalrequest.go | 1 + spec/electra/executionlayerwithdrawalrequest_json.go | 1 + spec/electra/executionlayerwithdrawalrequest_yaml.go | 1 + spec/electra/indexedattestation.go | 3 ++- spec/electra/pendingbalancedeposit.go | 1 + spec/electra/pendingbalancedeposit_json.go | 1 + spec/electra/pendingbalancedeposit_yaml.go | 1 + spec/electra/pendingconsolidation.go | 1 + spec/electra/pendingconsolidation_json.go | 1 + spec/electra/pendingconsolidation_yaml.go | 1 + spec/electra/pendingpartialwithdrawal.go | 1 + spec/electra/pendingpartialwithdrawal_json.go | 1 + spec/electra/pendingpartialwithdrawal_yaml.go | 1 + spec/electra/signedconsolidation.go | 1 + spec/electra/signedconsolidation_json.go | 1 + spec/electra/signedconsolidation_yaml.go | 1 + spec/phase0/types.go | 3 ++- spec/versionedattestation.go | 1 + spec/versionedbeaconblock.go | 1 + spec/versionedsignedbeaconblock.go | 1 + 77 files changed, 97 insertions(+), 47 deletions(-) diff --git a/api/v1/attesterduty_test.go b/api/v1/attesterduty_test.go index 20c0b438..59951f40 100644 --- a/api/v1/attesterduty_test.go +++ b/api/v1/attesterduty_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestAttesterDutyJSON(t *testing.T) { diff --git a/api/v1/beaconblockheader_test.go b/api/v1/beaconblockheader_test.go index 7cb969d3..b0e9f714 100644 --- a/api/v1/beaconblockheader_test.go +++ b/api/v1/beaconblockheader_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestBeaconBlockHeaderJSON(t *testing.T) { diff --git a/api/v1/beaconcommittee_test.go b/api/v1/beaconcommittee_test.go index 5ef8cc17..7ede7a50 100644 --- a/api/v1/beaconcommittee_test.go +++ b/api/v1/beaconcommittee_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestBeaconCommitteeJSON(t *testing.T) { diff --git a/api/v1/beaconcommitteesubscription_test.go b/api/v1/beaconcommitteesubscription_test.go index a8ba9465..936bd35c 100644 --- a/api/v1/beaconcommitteesubscription_test.go +++ b/api/v1/beaconcommitteesubscription_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestBeaconCommitteeSubscriptionJSON(t *testing.T) { diff --git a/api/v1/blockevent_test.go b/api/v1/blockevent_test.go index 42d8760f..08048cfc 100644 --- a/api/v1/blockevent_test.go +++ b/api/v1/blockevent_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestBlockEventJSON(t *testing.T) { diff --git a/api/v1/capella/blindedbeaconblock_test.go b/api/v1/capella/blindedbeaconblock_test.go index 7a15bddd..b8713dea 100644 --- a/api/v1/capella/blindedbeaconblock_test.go +++ b/api/v1/capella/blindedbeaconblock_test.go @@ -20,8 +20,8 @@ import ( "github.com/attestantio/go-eth2-client/api/v1/capella" "github.com/goccy/go-yaml" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestBlindedBeaconBlockJSON(t *testing.T) { diff --git a/api/v1/capella/signedblindedbeaconblock_test.go b/api/v1/capella/signedblindedbeaconblock_test.go index ebc7d0ca..b5efba44 100644 --- a/api/v1/capella/signedblindedbeaconblock_test.go +++ b/api/v1/capella/signedblindedbeaconblock_test.go @@ -20,8 +20,8 @@ import ( "github.com/attestantio/go-eth2-client/api/v1/capella" "github.com/goccy/go-yaml" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestSignedBlindedBeaconBlockJSON(t *testing.T) { diff --git a/api/v1/chainreorgevent_test.go b/api/v1/chainreorgevent_test.go index c5760393..d003bbd2 100644 --- a/api/v1/chainreorgevent_test.go +++ b/api/v1/chainreorgevent_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestChainReorgEventJSON(t *testing.T) { diff --git a/api/v1/depositcontract_test.go b/api/v1/depositcontract_test.go index 732bd070..72d32cc1 100644 --- a/api/v1/depositcontract_test.go +++ b/api/v1/depositcontract_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestDepositContractJSON(t *testing.T) { diff --git a/api/v1/electra/blindedbeaconblockbody.go b/api/v1/electra/blindedbeaconblockbody.go index ba210628..febc8d08 100644 --- a/api/v1/electra/blindedbeaconblockbody.go +++ b/api/v1/electra/blindedbeaconblockbody.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/deneb" "github.com/attestantio/go-eth2-client/spec/electra" diff --git a/api/v1/electra/blindedbeaconblockbody_json.go b/api/v1/electra/blindedbeaconblockbody_json.go index d21a5daa..aab420df 100644 --- a/api/v1/electra/blindedbeaconblockbody_json.go +++ b/api/v1/electra/blindedbeaconblockbody_json.go @@ -17,9 +17,10 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/attestantio/go-eth2-client/spec/electra" "strings" + "github.com/attestantio/go-eth2-client/spec/electra" + "github.com/attestantio/go-eth2-client/spec/altair" "github.com/attestantio/go-eth2-client/spec/capella" "github.com/attestantio/go-eth2-client/spec/deneb" diff --git a/api/v1/electra/blindedbeaconblockbody_yaml.go b/api/v1/electra/blindedbeaconblockbody_yaml.go index 0876a19e..2228b803 100644 --- a/api/v1/electra/blindedbeaconblockbody_yaml.go +++ b/api/v1/electra/blindedbeaconblockbody_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "fmt" + "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/spec/altair" diff --git a/api/v1/electra/blockcontents.go b/api/v1/electra/blockcontents.go index a9f32f0b..26f69c9b 100644 --- a/api/v1/electra/blockcontents.go +++ b/api/v1/electra/blockcontents.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/deneb" "github.com/attestantio/go-eth2-client/spec/electra" diff --git a/api/v1/electra/blockcontents_json.go b/api/v1/electra/blockcontents_json.go index f7fd9270..22b937c0 100644 --- a/api/v1/electra/blockcontents_json.go +++ b/api/v1/electra/blockcontents_json.go @@ -15,6 +15,7 @@ package electra import ( "encoding/json" + "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/codecs" diff --git a/api/v1/electra/blockcontents_yaml.go b/api/v1/electra/blockcontents_yaml.go index 5b5d3d37..a09a77b9 100644 --- a/api/v1/electra/blockcontents_yaml.go +++ b/api/v1/electra/blockcontents_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "encoding/json" + "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/spec/deneb" diff --git a/api/v1/electra/signedblockcontents.go b/api/v1/electra/signedblockcontents.go index 8c5acf6a..f3873645 100644 --- a/api/v1/electra/signedblockcontents.go +++ b/api/v1/electra/signedblockcontents.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/deneb" "github.com/attestantio/go-eth2-client/spec/electra" diff --git a/api/v1/electra/signedblockcontents_json.go b/api/v1/electra/signedblockcontents_json.go index 4cf27156..6ecbaa21 100644 --- a/api/v1/electra/signedblockcontents_json.go +++ b/api/v1/electra/signedblockcontents_json.go @@ -15,6 +15,7 @@ package electra import ( "encoding/json" + "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/codecs" diff --git a/api/v1/electra/signedblockcontents_yaml.go b/api/v1/electra/signedblockcontents_yaml.go index 1416ff38..46dae692 100644 --- a/api/v1/electra/signedblockcontents_yaml.go +++ b/api/v1/electra/signedblockcontents_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "encoding/json" + "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/spec/deneb" diff --git a/api/v1/event_test.go b/api/v1/event_test.go index 4035cedc..ca553f17 100644 --- a/api/v1/event_test.go +++ b/api/v1/event_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestEvent(t *testing.T) { diff --git a/api/v1/finality_test.go b/api/v1/finality_test.go index aa4216e1..0dfb9033 100644 --- a/api/v1/finality_test.go +++ b/api/v1/finality_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestFinalityJSON(t *testing.T) { diff --git a/api/v1/finalizedcheckpointevent_test.go b/api/v1/finalizedcheckpointevent_test.go index 98a7d018..6bc5f06c 100644 --- a/api/v1/finalizedcheckpointevent_test.go +++ b/api/v1/finalizedcheckpointevent_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestFinalizedCheckpointEventJSON(t *testing.T) { diff --git a/api/v1/genesis_test.go b/api/v1/genesis_test.go index bba3722a..c2224de8 100644 --- a/api/v1/genesis_test.go +++ b/api/v1/genesis_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestGenesisJSON(t *testing.T) { diff --git a/api/v1/headevent_test.go b/api/v1/headevent_test.go index 208d4f01..de7bb609 100644 --- a/api/v1/headevent_test.go +++ b/api/v1/headevent_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestHeadEventJSON(t *testing.T) { diff --git a/api/v1/payloadattributesevent.go b/api/v1/payloadattributesevent.go index dd364f9a..8b7055ad 100644 --- a/api/v1/payloadattributesevent.go +++ b/api/v1/payloadattributesevent.go @@ -4,10 +4,11 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/attestantio/go-eth2-client/spec/electra" "strconv" "strings" + "github.com/attestantio/go-eth2-client/spec/electra" + "github.com/attestantio/go-eth2-client/spec" "github.com/attestantio/go-eth2-client/spec/bellatrix" "github.com/attestantio/go-eth2-client/spec/capella" diff --git a/api/v1/proposalpreparation_test.go b/api/v1/proposalpreparation_test.go index f51ef0df..f6a09fd1 100644 --- a/api/v1/proposalpreparation_test.go +++ b/api/v1/proposalpreparation_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestProposalPreparationJSON(t *testing.T) { diff --git a/api/v1/proposerduty_test.go b/api/v1/proposerduty_test.go index c3322786..5d7bf77c 100644 --- a/api/v1/proposerduty_test.go +++ b/api/v1/proposerduty_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestProposerDutyJSON(t *testing.T) { diff --git a/api/v1/signedvalidatorregistration_test.go b/api/v1/signedvalidatorregistration_test.go index 0209c6ea..1272f5ec 100644 --- a/api/v1/signedvalidatorregistration_test.go +++ b/api/v1/signedvalidatorregistration_test.go @@ -20,8 +20,8 @@ import ( api "github.com/attestantio/go-eth2-client/api/v1" "github.com/goccy/go-yaml" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestSignedValidatorRegistrationJSON(t *testing.T) { diff --git a/api/v1/synccommittee_test.go b/api/v1/synccommittee_test.go index 34fe7bb0..0d63faf5 100644 --- a/api/v1/synccommittee_test.go +++ b/api/v1/synccommittee_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestSyncCommitteeJSON(t *testing.T) { diff --git a/api/v1/synccommitteeduty_test.go b/api/v1/synccommitteeduty_test.go index 88b5b76f..cc6d27ac 100644 --- a/api/v1/synccommitteeduty_test.go +++ b/api/v1/synccommitteeduty_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestSyncCommitteeDutyJSON(t *testing.T) { diff --git a/api/v1/synccommitteesubscription_test.go b/api/v1/synccommitteesubscription_test.go index 6742e64e..57ad64e3 100644 --- a/api/v1/synccommitteesubscription_test.go +++ b/api/v1/synccommitteesubscription_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestSyncCommitteeSubscriptionJSON(t *testing.T) { diff --git a/api/v1/syncstate_test.go b/api/v1/syncstate_test.go index 98276dfb..7e1a41e6 100644 --- a/api/v1/syncstate_test.go +++ b/api/v1/syncstate_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestSyncStateJSON(t *testing.T) { diff --git a/api/v1/validator_test.go b/api/v1/validator_test.go index 49aba706..ec889d77 100644 --- a/api/v1/validator_test.go +++ b/api/v1/validator_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestValidatorJSON(t *testing.T) { diff --git a/api/v1/validatorbalance_test.go b/api/v1/validatorbalance_test.go index 48bb3e59..423c5a12 100644 --- a/api/v1/validatorbalance_test.go +++ b/api/v1/validatorbalance_test.go @@ -18,8 +18,8 @@ import ( "testing" api "github.com/attestantio/go-eth2-client/api/v1" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestValidatorBalanceJSON(t *testing.T) { diff --git a/api/v1/validatorregistration_test.go b/api/v1/validatorregistration_test.go index 807573c3..ea837fdd 100644 --- a/api/v1/validatorregistration_test.go +++ b/api/v1/validatorregistration_test.go @@ -20,8 +20,8 @@ import ( api "github.com/attestantio/go-eth2-client/api/v1" "github.com/goccy/go-yaml" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestValidatorRegistrationJSON(t *testing.T) { diff --git a/api/v1/validatorstate_test.go b/api/v1/validatorstate_test.go index 22153139..0855e9c6 100644 --- a/api/v1/validatorstate_test.go +++ b/api/v1/validatorstate_test.go @@ -436,7 +436,7 @@ func TestMarshalJSON(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { require.NotPanics(t, func() { - res, err := json.Marshal(&test.state) //test.state.MarshalJSON() + res, err := json.Marshal(&test.state) // test.state.MarshalJSON() test.errFunc(t, err) require.Equal(t, test.expected, res) }) diff --git a/api/versionedproposal.go b/api/versionedproposal.go index 34a7d4e0..4fe07943 100644 --- a/api/versionedproposal.go +++ b/api/versionedproposal.go @@ -14,9 +14,10 @@ package api import ( - apiv1electra "github.com/attestantio/go-eth2-client/api/v1/electra" "math/big" + apiv1electra "github.com/attestantio/go-eth2-client/api/v1/electra" + apiv1bellatrix "github.com/attestantio/go-eth2-client/api/v1/bellatrix" apiv1capella "github.com/attestantio/go-eth2-client/api/v1/capella" apiv1deneb "github.com/attestantio/go-eth2-client/api/v1/deneb" diff --git a/api/versionedsignedproposal.go b/api/versionedsignedproposal.go index 62772288..6ce45440 100644 --- a/api/versionedsignedproposal.go +++ b/api/versionedsignedproposal.go @@ -15,9 +15,10 @@ package api import ( "errors" - apiv1electra "github.com/attestantio/go-eth2-client/api/v1/electra" "math/big" + apiv1electra "github.com/attestantio/go-eth2-client/api/v1/electra" + apiv1bellatrix "github.com/attestantio/go-eth2-client/api/v1/bellatrix" apiv1capella "github.com/attestantio/go-eth2-client/api/v1/capella" apiv1deneb "github.com/attestantio/go-eth2-client/api/v1/deneb" diff --git a/http/beaconstate.go b/http/beaconstate.go index 3ebac253..1dc7fb1c 100644 --- a/http/beaconstate.go +++ b/http/beaconstate.go @@ -18,6 +18,7 @@ import ( "context" "errors" "fmt" + "github.com/attestantio/go-eth2-client/spec/electra" client "github.com/attestantio/go-eth2-client" diff --git a/http/blindedproposal.go b/http/blindedproposal.go index 84b5cc97..ea1c6d94 100644 --- a/http/blindedproposal.go +++ b/http/blindedproposal.go @@ -18,6 +18,7 @@ import ( "context" "errors" "fmt" + apiv1electra "github.com/attestantio/go-eth2-client/api/v1/electra" client "github.com/attestantio/go-eth2-client" diff --git a/http/proposal.go b/http/proposal.go index ee36b27c..2baf737b 100644 --- a/http/proposal.go +++ b/http/proposal.go @@ -18,10 +18,11 @@ import ( "context" "errors" "fmt" - apiv1electra "github.com/attestantio/go-eth2-client/api/v1/electra" "math/big" "strings" + apiv1electra "github.com/attestantio/go-eth2-client/api/v1/electra" + client "github.com/attestantio/go-eth2-client" "github.com/attestantio/go-eth2-client/api" apiv1bellatrix "github.com/attestantio/go-eth2-client/api/v1/bellatrix" diff --git a/http/signedbeaconblock.go b/http/signedbeaconblock.go index c95b733b..643f0fcf 100644 --- a/http/signedbeaconblock.go +++ b/http/signedbeaconblock.go @@ -18,6 +18,7 @@ import ( "context" "errors" "fmt" + "github.com/attestantio/go-eth2-client/spec/electra" client "github.com/attestantio/go-eth2-client" diff --git a/http/submitattesterslashing_test.go b/http/submitattesterslashing_test.go index f313c706..f0b948cf 100644 --- a/http/submitattesterslashing_test.go +++ b/http/submitattesterslashing_test.go @@ -15,16 +15,16 @@ package http_test import ( "context" + "os" + "testing" + client "github.com/attestantio/go-eth2-client" "github.com/attestantio/go-eth2-client/http" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/stretchr/testify/require" - "os" - "testing" ) func TestSubmitAttesterSlashing(t *testing.T) { - service, err := http.New(context.Background(), http.WithTimeout(timeout), http.WithAddress(os.Getenv("HTTP_ADDRESS")), @@ -73,14 +73,15 @@ func TestSubmitAttesterSlashing(t *testing.T) { Signature: phase0.BLSSignature{0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf}, }, }, - }} + }, + } for _, test := range tests { t.Run(test.name, func(t *testing.T) { // Create proposal slashing and submit. err := service.(client.AttesterSlashingSubmitter).SubmitAttesterSlashing(context.Background(), &test.slashing) // This should error on bad slashing - require.Error(t, err) //we should be getting errors about non-slashable attestations or signatures + require.Error(t, err) // we should be getting errors about non-slashable attestations or signatures }) } } diff --git a/http/submitproposalslashing_test.go b/http/submitproposalslashing_test.go index d27f675d..ab4f3414 100644 --- a/http/submitproposalslashing_test.go +++ b/http/submitproposalslashing_test.go @@ -15,16 +15,16 @@ package http_test import ( "context" + "os" + "testing" + client "github.com/attestantio/go-eth2-client" "github.com/attestantio/go-eth2-client/http" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/stretchr/testify/require" - "os" - "testing" ) func TestSubmitProposalSlashing(t *testing.T) { - service, err := http.New(context.Background(), http.WithTimeout(timeout), http.WithAddress(os.Getenv("HTTP_ADDRESS")), @@ -77,14 +77,15 @@ func TestSubmitProposalSlashing(t *testing.T) { Signature: phase0.BLSSignature([96]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}), }, }, - }} + }, + } for _, test := range tests { t.Run(test.name, func(t *testing.T) { // Create proposal slashing and submit. err := service.(client.ProposalSlashingSubmitter).SubmitProposalSlashing(context.Background(), &test.slashing) // This should error on bad slashing - require.Error(t, err) //we should get error 400 with an invalid signature + require.Error(t, err) // we should get error 400 with an invalid signature }) } } diff --git a/spec/capella/historicalsummary_json_test.go b/spec/capella/historicalsummary_json_test.go index ed080e74..c2b54824 100644 --- a/spec/capella/historicalsummary_json_test.go +++ b/spec/capella/historicalsummary_json_test.go @@ -18,8 +18,8 @@ import ( "testing" "github.com/attestantio/go-eth2-client/spec/capella" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestHistoricalSummaryJSON(t *testing.T) { diff --git a/spec/capella/historicalsummary_yaml_test.go b/spec/capella/historicalsummary_yaml_test.go index ba963e36..65f9e33c 100644 --- a/spec/capella/historicalsummary_yaml_test.go +++ b/spec/capella/historicalsummary_yaml_test.go @@ -19,8 +19,8 @@ import ( "github.com/attestantio/go-eth2-client/spec/capella" "github.com/goccy/go-yaml" - require "github.com/stretchr/testify/require" "github.com/stretchr/testify/assert" + require "github.com/stretchr/testify/require" ) func TestHistoricalSummaryYAML(t *testing.T) { diff --git a/spec/electra/attestation.go b/spec/electra/attestation.go index 4659b313..0354aba6 100644 --- a/spec/electra/attestation.go +++ b/spec/electra/attestation.go @@ -18,9 +18,10 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/attestantio/go-eth2-client/spec/phase0" "strings" + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/goccy/go-yaml" "github.com/pkg/errors" bitfield "github.com/prysmaticlabs/go-bitfield" diff --git a/spec/electra/beaconblockbody.go b/spec/electra/beaconblockbody.go index 0ae82d6e..aa2a5af9 100644 --- a/spec/electra/beaconblockbody.go +++ b/spec/electra/beaconblockbody.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/deneb" "github.com/attestantio/go-eth2-client/spec/altair" diff --git a/spec/electra/beaconblockbody_json.go b/spec/electra/beaconblockbody_json.go index d2a3c9f8..35701c61 100644 --- a/spec/electra/beaconblockbody_json.go +++ b/spec/electra/beaconblockbody_json.go @@ -18,6 +18,7 @@ import ( "encoding/hex" "encoding/json" "fmt" + "github.com/attestantio/go-eth2-client/codecs" "github.com/attestantio/go-eth2-client/spec/altair" "github.com/attestantio/go-eth2-client/spec/capella" diff --git a/spec/electra/beaconblockbody_yaml.go b/spec/electra/beaconblockbody_yaml.go index 107bce50..9a94547a 100644 --- a/spec/electra/beaconblockbody_yaml.go +++ b/spec/electra/beaconblockbody_yaml.go @@ -17,6 +17,7 @@ import ( "bytes" "encoding/json" "fmt" + "github.com/attestantio/go-eth2-client/spec/altair" "github.com/attestantio/go-eth2-client/spec/capella" "github.com/attestantio/go-eth2-client/spec/phase0" diff --git a/spec/electra/beaconstate.go b/spec/electra/beaconstate.go index 191122a7..8ee1463b 100644 --- a/spec/electra/beaconstate.go +++ b/spec/electra/beaconstate.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/altair" "github.com/attestantio/go-eth2-client/spec/capella" "github.com/attestantio/go-eth2-client/spec/phase0" diff --git a/spec/electra/beaconstate_yaml.go b/spec/electra/beaconstate_yaml.go index 2989130d..4b053e5c 100644 --- a/spec/electra/beaconstate_yaml.go +++ b/spec/electra/beaconstate_yaml.go @@ -17,6 +17,7 @@ import ( "bytes" "encoding/json" "fmt" + "github.com/attestantio/go-eth2-client/spec/altair" "github.com/attestantio/go-eth2-client/spec/capella" "github.com/attestantio/go-eth2-client/spec/phase0" diff --git a/spec/electra/consolidation.go b/spec/electra/consolidation.go index c9b99707..9cda3cc5 100644 --- a/spec/electra/consolidation.go +++ b/spec/electra/consolidation.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" ) diff --git a/spec/electra/consolidation_json.go b/spec/electra/consolidation_json.go index 3a65d1d2..e7ca474f 100644 --- a/spec/electra/consolidation_json.go +++ b/spec/electra/consolidation_json.go @@ -15,6 +15,7 @@ package electra import ( "encoding/json" + "github.com/attestantio/go-eth2-client/codecs" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/pkg/errors" diff --git a/spec/electra/consolidation_yaml.go b/spec/electra/consolidation_yaml.go index 52555c14..f7176644 100644 --- a/spec/electra/consolidation_yaml.go +++ b/spec/electra/consolidation_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "encoding/json" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" "github.com/pkg/errors" diff --git a/spec/electra/depositreceipt.go b/spec/electra/depositreceipt.go index e91eae69..0b5689bb 100644 --- a/spec/electra/depositreceipt.go +++ b/spec/electra/depositreceipt.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" ) diff --git a/spec/electra/depositreceipt_json.go b/spec/electra/depositreceipt_json.go index 0ea19bf9..d9239915 100644 --- a/spec/electra/depositreceipt_json.go +++ b/spec/electra/depositreceipt_json.go @@ -17,10 +17,11 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/attestantio/go-eth2-client/spec/phase0" - "github.com/pkg/errors" "strconv" "strings" + + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/pkg/errors" ) // depositReceiptJSON is the spec representation of the struct. diff --git a/spec/electra/depositreceipt_yaml.go b/spec/electra/depositreceipt_yaml.go index f4c99343..8efd082c 100644 --- a/spec/electra/depositreceipt_yaml.go +++ b/spec/electra/depositreceipt_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "fmt" + "github.com/goccy/go-yaml" ) diff --git a/spec/electra/executionlayerwithdrawalrequest.go b/spec/electra/executionlayerwithdrawalrequest.go index 13a1438d..45d3e826 100644 --- a/spec/electra/executionlayerwithdrawalrequest.go +++ b/spec/electra/executionlayerwithdrawalrequest.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/bellatrix" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" diff --git a/spec/electra/executionlayerwithdrawalrequest_json.go b/spec/electra/executionlayerwithdrawalrequest_json.go index fedf3474..e4fab2d7 100644 --- a/spec/electra/executionlayerwithdrawalrequest_json.go +++ b/spec/electra/executionlayerwithdrawalrequest_json.go @@ -15,6 +15,7 @@ package electra import ( "encoding/json" + "github.com/attestantio/go-eth2-client/codecs" "github.com/attestantio/go-eth2-client/spec/bellatrix" "github.com/attestantio/go-eth2-client/spec/phase0" diff --git a/spec/electra/executionlayerwithdrawalrequest_yaml.go b/spec/electra/executionlayerwithdrawalrequest_yaml.go index bcb38f93..744a1e68 100644 --- a/spec/electra/executionlayerwithdrawalrequest_yaml.go +++ b/spec/electra/executionlayerwithdrawalrequest_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "encoding/json" + "github.com/attestantio/go-eth2-client/spec/bellatrix" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" diff --git a/spec/electra/indexedattestation.go b/spec/electra/indexedattestation.go index a8f03693..0858043a 100644 --- a/spec/electra/indexedattestation.go +++ b/spec/electra/indexedattestation.go @@ -18,10 +18,11 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/attestantio/go-eth2-client/spec/phase0" "strconv" "strings" + "github.com/attestantio/go-eth2-client/spec/phase0" + "github.com/goccy/go-yaml" "github.com/pkg/errors" ) diff --git a/spec/electra/pendingbalancedeposit.go b/spec/electra/pendingbalancedeposit.go index e16ab1d1..10a5f228 100644 --- a/spec/electra/pendingbalancedeposit.go +++ b/spec/electra/pendingbalancedeposit.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" ) diff --git a/spec/electra/pendingbalancedeposit_json.go b/spec/electra/pendingbalancedeposit_json.go index ad5d7bea..d8304ac3 100644 --- a/spec/electra/pendingbalancedeposit_json.go +++ b/spec/electra/pendingbalancedeposit_json.go @@ -15,6 +15,7 @@ package electra import ( "encoding/json" + "github.com/attestantio/go-eth2-client/codecs" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/pkg/errors" diff --git a/spec/electra/pendingbalancedeposit_yaml.go b/spec/electra/pendingbalancedeposit_yaml.go index 2ba9781c..ad788b41 100644 --- a/spec/electra/pendingbalancedeposit_yaml.go +++ b/spec/electra/pendingbalancedeposit_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "encoding/json" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" "github.com/pkg/errors" diff --git a/spec/electra/pendingconsolidation.go b/spec/electra/pendingconsolidation.go index 9728a6fe..d45cf563 100644 --- a/spec/electra/pendingconsolidation.go +++ b/spec/electra/pendingconsolidation.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" ) diff --git a/spec/electra/pendingconsolidation_json.go b/spec/electra/pendingconsolidation_json.go index bdb85b21..3108e200 100644 --- a/spec/electra/pendingconsolidation_json.go +++ b/spec/electra/pendingconsolidation_json.go @@ -15,6 +15,7 @@ package electra import ( "encoding/json" + "github.com/attestantio/go-eth2-client/codecs" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/pkg/errors" diff --git a/spec/electra/pendingconsolidation_yaml.go b/spec/electra/pendingconsolidation_yaml.go index 5bcdff26..b10a1924 100644 --- a/spec/electra/pendingconsolidation_yaml.go +++ b/spec/electra/pendingconsolidation_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "encoding/json" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" "github.com/pkg/errors" diff --git a/spec/electra/pendingpartialwithdrawal.go b/spec/electra/pendingpartialwithdrawal.go index b3df4781..5e15b149 100644 --- a/spec/electra/pendingpartialwithdrawal.go +++ b/spec/electra/pendingpartialwithdrawal.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" ) diff --git a/spec/electra/pendingpartialwithdrawal_json.go b/spec/electra/pendingpartialwithdrawal_json.go index d9930bf2..ad307a99 100644 --- a/spec/electra/pendingpartialwithdrawal_json.go +++ b/spec/electra/pendingpartialwithdrawal_json.go @@ -15,6 +15,7 @@ package electra import ( "encoding/json" + "github.com/attestantio/go-eth2-client/codecs" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/pkg/errors" diff --git a/spec/electra/pendingpartialwithdrawal_yaml.go b/spec/electra/pendingpartialwithdrawal_yaml.go index 0bf7e724..100b8120 100644 --- a/spec/electra/pendingpartialwithdrawal_yaml.go +++ b/spec/electra/pendingpartialwithdrawal_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "encoding/json" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" "github.com/pkg/errors" diff --git a/spec/electra/signedconsolidation.go b/spec/electra/signedconsolidation.go index 8804f775..f8fe30da 100644 --- a/spec/electra/signedconsolidation.go +++ b/spec/electra/signedconsolidation.go @@ -15,6 +15,7 @@ package electra import ( "fmt" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" ) diff --git a/spec/electra/signedconsolidation_json.go b/spec/electra/signedconsolidation_json.go index b853352e..7ff53caf 100644 --- a/spec/electra/signedconsolidation_json.go +++ b/spec/electra/signedconsolidation_json.go @@ -15,6 +15,7 @@ package electra import ( "encoding/json" + "github.com/attestantio/go-eth2-client/codecs" "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/pkg/errors" diff --git a/spec/electra/signedconsolidation_yaml.go b/spec/electra/signedconsolidation_yaml.go index 3ebe6156..9d9abb6b 100644 --- a/spec/electra/signedconsolidation_yaml.go +++ b/spec/electra/signedconsolidation_yaml.go @@ -16,6 +16,7 @@ package electra import ( "bytes" "encoding/json" + "github.com/attestantio/go-eth2-client/spec/phase0" "github.com/goccy/go-yaml" "github.com/pkg/errors" diff --git a/spec/phase0/types.go b/spec/phase0/types.go index 421bf133..1b7d6d57 100644 --- a/spec/phase0/types.go +++ b/spec/phase0/types.go @@ -16,8 +16,9 @@ package phase0 import ( "bytes" "fmt" - "github.com/pkg/errors" "strconv" + + "github.com/pkg/errors" ) // Epoch is an epoch number. diff --git a/spec/versionedattestation.go b/spec/versionedattestation.go index 5f49208e..e7dc593c 100644 --- a/spec/versionedattestation.go +++ b/spec/versionedattestation.go @@ -15,6 +15,7 @@ package spec import ( "errors" + "github.com/prysmaticlabs/go-bitfield" "github.com/attestantio/go-eth2-client/spec/electra" diff --git a/spec/versionedbeaconblock.go b/spec/versionedbeaconblock.go index f1c83893..341b992d 100644 --- a/spec/versionedbeaconblock.go +++ b/spec/versionedbeaconblock.go @@ -15,6 +15,7 @@ package spec import ( "errors" + "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/spec/altair" diff --git a/spec/versionedsignedbeaconblock.go b/spec/versionedsignedbeaconblock.go index 60f24841..799025ad 100644 --- a/spec/versionedsignedbeaconblock.go +++ b/spec/versionedsignedbeaconblock.go @@ -15,6 +15,7 @@ package spec import ( "errors" + "github.com/attestantio/go-eth2-client/spec/electra" "github.com/attestantio/go-eth2-client/spec/altair"