Skip to content

Commit

Permalink
Merge branch 'rc/v1.4.0' into userAccountHandler-interface-change
Browse files Browse the repository at this point in the history
  • Loading branch information
BeniaminDrasovean authored Sep 22, 2022
2 parents b0a9fbe + 8d15f95 commit e3a1864
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
10 changes: 10 additions & 0 deletions data/block/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,3 +835,13 @@ func TestHeader_HasScheduledMiniBlocks(t *testing.T) {
h.MiniBlockHeaders = []block.MiniBlockHeader{*mbHeader}
require.False(t, h.HasScheduledMiniBlocks())
}

func TestMiniBlockHeader_GetMiniBlockHeaderReservedShouldErrWhenReservedFieldIsNil(t *testing.T) {
t.Parallel()

mbh := &block.MiniBlockHeader{}

mbhr, err := mbh.GetMiniBlockHeaderReserved()
assert.Nil(t, mbhr)
assert.Equal(t, data.ErrNilReservedField, err)
}
2 changes: 1 addition & 1 deletion data/block/miniBlockHeader.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (m *MiniBlockHeader) getMiniBlockHeaderReserved() (*MiniBlockHeaderReserved

return mbhr, nil
}
return nil, nil
return nil, data.ErrNilReservedField
}

// SetMiniBlockHeaderReserved sets the Reserved field for the miniBlock header with the given parameter
Expand Down
3 changes: 3 additions & 0 deletions data/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,6 @@ var ErrScheduledRootHashNotSupported = errors.New("scheduled root hash is not su

// ErrWrongTransactionsTypeSize signals that size of transactions type buffer from mini block reserved field is wrong
var ErrWrongTransactionsTypeSize = errors.New("wrong transactions type size")

// ErrNilReservedField signals that a nil reserved field was provided
var ErrNilReservedField = errors.New("reserved field is nil")

0 comments on commit e3a1864

Please sign in to comment.