Skip to content

Commit

Permalink
chore(lib/parachain): remove pov byte array and use pov struct (#3375)
Browse files Browse the repository at this point in the history
  • Loading branch information
axaysagathiya authored and kishansagathiya committed Jan 23, 2024
1 parent 137ad65 commit 50c06ab
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/parachain/available_data_fetching.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ func (a *AvailableDataFetchingResponse) Value() (val scale.VaryingDataTypeValue,
// AvailableData represents the data that is kept available for each candidate included in the relay chain.
type AvailableData struct {
// The Proof-of-Validation (PoV) of the candidate
PoV Pov `scale:"1"`
PoV PoV `scale:"1"`

// The persisted validation data needed for approval checks
ValidationData PersistedValidationData `scale:"2"`
}

// Pov represents a Proof-of-Validity block (PoV block) or a parachain block.
// PoV represents a Proof-of-Validity block (PoV block) or a parachain block.
// It contains the necessary data for the parachain specific state transition logic.
type Pov struct {
type PoV struct {
BlockData BlockData `scale:"1"`
}

Expand Down
2 changes: 1 addition & 1 deletion lib/parachain/available_data_fetching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestAvailableDataFetchingResponse(t *testing.T) {
testHash := common.MustHexToHash("0x677811d2f3ded2489685468dbdb2e4fa280a249fba9356acceb2e823820e2c19")
testBytes := testHash.ToBytes()
availableData := AvailableData{
PoV: Pov{BlockData: testBytes},
PoV: PoV{BlockData: testBytes},
ValidationData: PersistedValidationData{
ParentHead: testBytes,
RelayParentNumber: BlockNumber(4),
Expand Down
4 changes: 0 additions & 4 deletions lib/parachain/collation_fetching.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ type Collation struct {
PoV PoV `scale:"2"`
}

// PoV represents a Proof-of-Validity block (PoV block) or a parachain block.
// It contains the necessary data for the parachain specific state transition logic.
type PoV []byte

// Index returns the index of varying data type
func (Collation) Index() uint {
return 0
Expand Down
2 changes: 1 addition & 1 deletion lib/parachain/collation_fetching_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func TestCollationFetchingResponse(t *testing.T) {
},
CommitmentsHash: testHash,
},
PoV: PoV{1, 2, 3},
PoV: PoV{BlockData{1, 2, 3}},
}

// expected encoding is generated by running rust test code:
Expand Down

0 comments on commit 50c06ab

Please sign in to comment.