mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-01-02 13:33:10 +00:00
Removed modules: - sales (including reservations, slot queue, marketplace abstractions, state machines, etc) - purchasing - erasure coding - contract interactions - prover - slot builder - block exchange payments - sales/purchasing from REST api - removed persistence command and all config params from cli configuration - CI workflows (devnet, dist tests, cirdl build, start eth node, contracts version reporting) - unused modules from tests - marketplace integration tests, and starting provider/validator/hardhat nodes - unused manifest properties - integration tests using the above # Conflicts: # .github/workflows/ci-reusable.yml # .github/workflows/docker.yml # build.nims # codex/blockexchange/engine/payments.nim # codex/codex.nim # codex/conf.nim # codex/contracts/Readme.md # codex/erasure.nim # codex/erasure/backend.nim # codex/erasure/backends/leopard.nim # codex/erasure/erasure.nim # codex/rest/api.nim # codex/sales.nim # codex/sales/reservations.nim # codex/sales/states/filled.nim # codex/sales/states/preparing.nim # codex/sales/states/provingsimulated.nim # codex/slots/builder/builder.nim # codex/slots/converters.nim # codex/slots/proofs/backends/circomcompat.nim # codex/slots/proofs/backends/converters.nim # codex/slots/proofs/prover.nim # codex/slots/sampler/sampler.nim # codex/slots/sampler/utils.nim # codex/slots/types.nim # tests/integration/5_minutes/testrestapivalidation.nim # tests/integration/hardhatprocess.nim # tests/integration/multinodes.nim # tools/cirdl/cirdl.nim
44 lines
1.1 KiB
Nim
44 lines
1.1 KiB
Nim
## Logos Storage
|
|
## Copyright (c) 2021 Status Research & Development GmbH
|
|
## Licensed under either of
|
|
## * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
|
|
## * MIT license ([LICENSE-MIT](LICENSE-MIT))
|
|
## at your option.
|
|
## This file may not be copied, modified, or distributed except according to
|
|
## those terms.
|
|
|
|
import std/hashes
|
|
import std/sequtils
|
|
|
|
import message
|
|
|
|
import ../../blocktype
|
|
|
|
export Message, protobufEncode, protobufDecode
|
|
export Wantlist, WantType, WantListEntry
|
|
export BlockDelivery, BlockPresenceType, BlockPresence
|
|
|
|
proc hash*(e: WantListEntry): Hash =
|
|
hash(e.address)
|
|
|
|
proc contains*(a: openArray[WantListEntry], b: BlockAddress): bool =
|
|
## Convenience method to check for peer precense
|
|
##
|
|
|
|
a.anyIt(it.address == b)
|
|
|
|
proc `==`*(a: WantListEntry, b: BlockAddress): bool =
|
|
return a.address == b
|
|
|
|
proc `<`*(a, b: WantListEntry): bool =
|
|
a.priority < b.priority
|
|
|
|
proc `==`*(a: BlockPresence, b: BlockAddress): bool =
|
|
return a.address == b
|
|
|
|
proc contains*(a: openArray[BlockPresence], b: BlockAddress): bool =
|
|
## Convenience method to check for peer precense
|
|
##
|
|
|
|
a.anyIt(it.address == b)
|