Skip to content

Commit

Permalink
Temporarily mock tortoise beacon
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Aug 26, 2021
1 parent b1c83e1 commit a4ac09a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tortoisebeacon/tortoise_beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package tortoisebeacon

import (
"context"
"encoding/binary"
"errors"
"fmt"
"math/big"
Expand Down Expand Up @@ -222,6 +223,10 @@ func (tb *TortoiseBeacon) IsClosed() bool {
// GetBeacon returns a Tortoise Beacon value as []byte for a certain epoch or an error if it doesn't exist.
// TODO(nkryuchkov): consider not using (using DB instead)
func (tb *TortoiseBeacon) GetBeacon(epochID types.EpochID) ([]byte, error) {
b := make([]byte, 4)
binary.LittleEndian.PutUint32(b, uint32(epochID))
return b, nil

if epochID == 0 {
return nil, ErrZeroEpoch
}
Expand Down

0 comments on commit a4ac09a

Please sign in to comment.