Skip to content

Commit

Permalink
Merge pull request #139 from fearlessfe/beacon
Browse files Browse the repository at this point in the history
fix: beacon chain tests
  • Loading branch information
fearlessfe authored Aug 27, 2024
2 parents 2a381fc + 332960b commit 75885b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
3 changes: 1 addition & 2 deletions portalnetwork/beacon/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ func (bs *BeaconStorage) Put(contentKey []byte, contentId []byte, content []byte
}

func (bs *BeaconStorage) Radius() *uint256.Int {
// TODO
panic("implement me")
return storage.MaxDistance
}

func (bs *BeaconStorage) getContentValue(contentId []byte) ([]byte, error) {
Expand Down
6 changes: 1 addition & 5 deletions portalnetwork/history/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ const (
ORDER BY distance DESC`
)

var (
maxDistance = uint256.MustFromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
)

var _ storage.ContentStorage = &ContentStorage{}
var once sync.Once

Expand Down Expand Up @@ -108,7 +104,7 @@ func NewHistoryStorage(config storage.PortalStorageConfig) (storage.ContentStora
storageCapacityInBytes: config.StorageCapacityMB * 1000000,
log: log.New("history_storage"),
}
hs.radius.Store(maxDistance)
hs.radius.Store(storage.MaxDistance)
err := hs.createTable()
if err != nil {
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions portalnetwork/storage/content_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (

var ErrContentNotFound = fmt.Errorf("content not found")

var MaxDistance = uint256.MustFromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")

type ContentType byte

type ContentKey struct {
Expand Down

0 comments on commit 75885b5

Please sign in to comment.