Merge pull request #139 from fearlessfe/beacon

fix: beacon chain tests
This commit is contained in:
彭振 2024-08-27 21:35:20 +08:00 committed by GitHub
commit 75885b57eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 7 deletions

View file

@ -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) {

View file

@ -38,10 +38,6 @@ const (
ORDER BY distance DESC`
)
var (
maxDistance = uint256.MustFromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
)
var _ storage.ContentStorage = &ContentStorage{}
var once sync.Once
@ -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

View file

@ -8,6 +8,8 @@ import (
var ErrContentNotFound = fmt.Errorf("content not found")
var MaxDistance = uint256.MustFromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
type ContentType byte
type ContentKey struct {