Skip to content

Commit

Permalink
FEAT: Add epoch start economics in sov block
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Jul 18, 2024
1 parent 3d38f8e commit 28d7949
Show file tree
Hide file tree
Showing 3 changed files with 505 additions and 35 deletions.
34 changes: 34 additions & 0 deletions data/block/sovereignChainHeader.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,40 @@ func (sch *SovereignChainHeader) SetStartOfEpochHeader() error {
return nil
}

// SetDevFeesInEpoch sets the developer fees in the header
func (sch *SovereignChainHeader) SetDevFeesInEpoch(value *big.Int) error {
if sch == nil {
return data.ErrNilPointerReceiver
}
if value == nil {
return data.ErrInvalidValue
}
if sch.DevFeesInEpoch == nil {
sch.DevFeesInEpoch = big.NewInt(0)
}

sch.DevFeesInEpoch.Set(value)

return nil
}

// SetAccumulatedFeesInEpoch sets the epoch accumulated fees in the header
func (sch *SovereignChainHeader) SetAccumulatedFeesInEpoch(value *big.Int) error {
if sch == nil {
return data.ErrNilPointerReceiver
}
if value == nil {
return data.ErrInvalidValue
}
if sch.AccumulatedFeesInEpoch == nil {
sch.AccumulatedFeesInEpoch = big.NewInt(0)
}

sch.AccumulatedFeesInEpoch.Set(value)

return nil
}

// SetHash returns the hash
func (omb *OutGoingMiniBlockHeader) SetHash(hash []byte) error {
if omb == nil {
Expand Down
Loading

0 comments on commit 28d7949

Please sign in to comment.