Skip to content

Commit

Permalink
bet
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed Aug 7, 2024
1 parent 49be5a8 commit 2b5fa8c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 51 deletions.
4 changes: 2 additions & 2 deletions mod/consensus-types/pkg/types/attestation_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"testing"

"github.com/berachain/beacon-kit/mod/consensus-types/pkg/types"
"github.com/berachain/beacon-kit/mod/primitives/pkg/bytes"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestAttestationData_GetTree(t *testing.T) {

func TestAttestationData_Getters(t *testing.T) {
data := generateAttestationData()
beaconBlockRoot := bytes.B32{
beaconBlockRoot := common.Root{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
}
Expand Down
5 changes: 2 additions & 3 deletions mod/consensus-types/pkg/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"testing"

"github.com/berachain/beacon-kit/mod/consensus-types/pkg/types"
gethprimitives "github.com/berachain/beacon-kit/mod/geth-primitives"
"github.com/berachain/beacon-kit/mod/primitives/pkg/bytes"
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
"github.com/berachain/beacon-kit/mod/primitives/pkg/math"
Expand All @@ -51,10 +50,10 @@ func TestDefaultGenesisDeneb(t *testing.T) {
// add assertions for ExecutionPayloadHeader
require.NotNil(t, g.ExecutionPayloadHeader,
"Expected ExecutionPayloadHeader to be non-nil")
require.Equal(t, gethprimitives.ZeroHash,
require.Equal(t, common.ExecutionHash{},
g.ExecutionPayloadHeader.GetParentHash(),
"Unexpected ParentHash")
require.Equal(t, gethprimitives.ZeroAddress,
require.Equal(t, common.ExecutionAddress{},
g.ExecutionPayloadHeader.GetFeeRecipient(),
"Unexpected FeeRecipient")
require.Equal(t, math.U64(30000000),
Expand Down
4 changes: 2 additions & 2 deletions mod/consensus-types/pkg/types/payload_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func TestExecutionPayloadHeader_Getters(t *testing.T) {
require.Equal(t, []byte(nil), header.GetExtraData())
require.Equal(t, math.NewU256(0), header.GetBaseFeePerGas())
require.Equal(t, common.ExecutionHash{}, header.GetBlockHash())
require.Equal(t, bytes.B32{}, header.GetTransactionsRoot())
require.Equal(t, bytes.B32{}, header.GetWithdrawalsRoot())
require.Equal(t, common.Root{}, header.GetTransactionsRoot())
require.Equal(t, common.Root{}, header.GetWithdrawalsRoot())
require.Equal(t, math.U64(0), header.GetBlobGasUsed())
require.Equal(t, math.U64(0), header.GetExcessBlobGas())
}
Expand Down
38 changes: 19 additions & 19 deletions mod/da/pkg/types/sidecar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ func TestSidecarMarshalling(t *testing.T) {
eip4844.KZGCommitment{},
eip4844.KZGProof{},
[]common.Root{
byteslib.ToBytes32([]byte("1")),
byteslib.ToBytes32([]byte("2")),
byteslib.ToBytes32([]byte("3")),
byteslib.ToBytes32([]byte("4")),
byteslib.ToBytes32([]byte("5")),
byteslib.ToBytes32([]byte("6")),
byteslib.ToBytes32([]byte("7")),
byteslib.ToBytes32([]byte("8")),
common.Root(byteslib.ToBytes32([]byte("1"))),
common.Root(byteslib.ToBytes32([]byte("2"))),
common.Root(byteslib.ToBytes32([]byte("3"))),
common.Root(byteslib.ToBytes32([]byte("4"))),
common.Root(byteslib.ToBytes32([]byte("5"))),
common.Root(byteslib.ToBytes32([]byte("6"))),
common.Root(byteslib.ToBytes32([]byte("7"))),
common.Root(byteslib.ToBytes32([]byte("8"))),
},
)

Expand Down Expand Up @@ -94,9 +94,9 @@ func TestHasValidInclusionProof(t *testing.T) {
eip4844.KZGCommitment{},
eip4844.KZGProof{},
[]common.Root{
byteslib.ToBytes32([]byte("4")),
byteslib.ToBytes32([]byte("5")),
byteslib.ToBytes32([]byte("6")),
common.Root(byteslib.ToBytes32([]byte("4"))),
common.Root(byteslib.ToBytes32([]byte("5"))),
common.Root(byteslib.ToBytes32([]byte("6"))),
},
),
kzgOffset: 0,
Expand Down Expand Up @@ -144,14 +144,14 @@ func TestHashTreeRoot(t *testing.T) {
eip4844.KZGCommitment{1, 2, 3},
eip4844.KZGProof{4, 5, 6},
[]common.Root{
byteslib.ToBytes32([]byte("1")),
byteslib.ToBytes32([]byte("2")),
byteslib.ToBytes32([]byte("3")),
byteslib.ToBytes32([]byte("4")),
byteslib.ToBytes32([]byte("5")),
byteslib.ToBytes32([]byte("6")),
byteslib.ToBytes32([]byte("7")),
byteslib.ToBytes32([]byte("8")),
common.Root(byteslib.ToBytes32([]byte("1"))),
common.Root(byteslib.ToBytes32([]byte("2"))),
common.Root(byteslib.ToBytes32([]byte("3"))),
common.Root(byteslib.ToBytes32([]byte("4"))),
common.Root(byteslib.ToBytes32([]byte("5"))),
common.Root(byteslib.ToBytes32([]byte("6"))),
common.Root(byteslib.ToBytes32([]byte("7"))),
common.Root(byteslib.ToBytes32([]byte("8"))),
},
),
expectedResult: [32]uint8{
Expand Down
49 changes: 24 additions & 25 deletions mod/da/pkg/types/sidecars_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ func TestEmptySidecarMarshalling(t *testing.T) {
eip4844.KZGCommitment{},
[48]byte{},
[]common.Root{
byteslib.ToBytes32([]byte("1")),
byteslib.ToBytes32([]byte("2")),
byteslib.ToBytes32([]byte("3")),
byteslib.ToBytes32([]byte("4")),
byteslib.ToBytes32([]byte("5")),
byteslib.ToBytes32([]byte("6")),
byteslib.ToBytes32([]byte("7")),
byteslib.ToBytes32([]byte("8")),
common.Root(byteslib.ToBytes32([]byte("1"))),
common.Root(byteslib.ToBytes32([]byte("2"))),
common.Root(byteslib.ToBytes32([]byte("3"))),
common.Root(byteslib.ToBytes32([]byte("4"))),
common.Root(byteslib.ToBytes32([]byte("5"))),
common.Root(byteslib.ToBytes32([]byte("6"))),
common.Root(byteslib.ToBytes32([]byte("7"))),
common.Root(byteslib.ToBytes32([]byte("8"))),
},
)

Expand Down Expand Up @@ -96,14 +96,14 @@ func TestValidateBlockRoots(t *testing.T) {
[48]byte{},
[48]byte{},
[]common.Root{
byteslib.ToBytes32([]byte("1")),
byteslib.ToBytes32([]byte("2")),
byteslib.ToBytes32([]byte("3")),
byteslib.ToBytes32([]byte("4")),
byteslib.ToBytes32([]byte("5")),
byteslib.ToBytes32([]byte("6")),
byteslib.ToBytes32([]byte("7")),
byteslib.ToBytes32([]byte("8")),
common.Root(byteslib.ToBytes32([]byte("1"))),
common.Root(byteslib.ToBytes32([]byte("2"))),
common.Root(byteslib.ToBytes32([]byte("3"))),
common.Root(byteslib.ToBytes32([]byte("4"))),
common.Root(byteslib.ToBytes32([]byte("5"))),
common.Root(byteslib.ToBytes32([]byte("6"))),
common.Root(byteslib.ToBytes32([]byte("7"))),
common.Root(byteslib.ToBytes32([]byte("8"))),
},
)

Expand All @@ -129,17 +129,16 @@ func TestValidateBlockRoots(t *testing.T) {
eip4844.KZGCommitment{},
eip4844.KZGProof{},
[]common.Root{
byteslib.ToBytes32([]byte("1")),
byteslib.ToBytes32([]byte("2")),
byteslib.ToBytes32([]byte("3")),
byteslib.ToBytes32([]byte("4")),
byteslib.ToBytes32([]byte("5")),
byteslib.ToBytes32([]byte("6")),
byteslib.ToBytes32([]byte("7")),
byteslib.ToBytes32([]byte("8")),
common.Root(byteslib.ToBytes32([]byte("1"))),
common.Root(byteslib.ToBytes32([]byte("2"))),
common.Root(byteslib.ToBytes32([]byte("3"))),
common.Root(byteslib.ToBytes32([]byte("4"))),
common.Root(byteslib.ToBytes32([]byte("5"))),
common.Root(byteslib.ToBytes32([]byte("6"))),
common.Root(byteslib.ToBytes32([]byte("7"))),
common.Root(byteslib.ToBytes32([]byte("8"))),
},
)

// Validate the sidecar with invalid roots
sidecarsInvalid := types.BlobSidecars{
Sidecars: []*types.BlobSidecar{
Expand Down

0 comments on commit 2b5fa8c

Please sign in to comment.