Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Copyright 2022 ChainSafe Systems (ON)
// SPDX-License-Identifier: LGPL-3.0-only

package babe
package types

import (
"fmt"

"github.com/ChainSafe/gossamer/dot/types"
"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/pkg/scale"
)
Expand Down Expand Up @@ -379,5 +378,5 @@ type ParachainInherentData struct {
// Sets of dispute votes for inclusion,
Disputes multiDisputeStatementSet `scale:"3"`
// The parent block header. Used for checking state proofs.
ParentHeader types.Header `scale:"4"`
ParentHeader Header `scale:"4"`
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Copyright 2022 ChainSafe Systems (ON)
// SPDX-License-Identifier: LGPL-3.0-only

package babe
package types

import (
"testing"

"github.com/ChainSafe/gossamer/dot/types"
"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/pkg/scale"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -276,9 +275,8 @@ func TestParachainInherents(t *testing.T) {
// let mut inherents: sp_inherents::InherentData = sp_inherents::InherentData::new();
// inherents.put_data(*b"parachn0", &para_int).unwrap();
// println!("{:?}", inherents.encode());

parachainInherent := ParachainInherentData{
ParentHeader: types.Header{
ParentHeader: Header{
ParentHash: common.MustBlake2bHash([]byte("1000")),
Number: uint(2000),
StateRoot: common.MustBlake2bHash([]byte("3000")),
Expand All @@ -291,8 +289,8 @@ func TestParachainInherents(t *testing.T) {

assert.Equal(t, expectedParaInherentsbytes, actualParaInherentBytes)

idata := types.NewInherentData()
err = idata.SetInherent(types.Parachn0, parachainInherent)
idata := NewInherentData()
err = idata.SetInherent(Parachn0, parachainInherent)
require.NoError(t, err)

actualInherentsBytes, err := idata.Encode()
Expand Down
2 changes: 1 addition & 1 deletion lib/babe/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func buildBlockInherents(slot Slot, rt ExtrinsicHandler, parent *types.Header) (
return nil, err
}

parachainInherent := ParachainInherentData{
parachainInherent := types.ParachainInherentData{
ParentHeader: *parent,
}

Expand Down