mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-07-26 06:23:14 +00:00
feat(store): allow eligibilityProofHex in store query JSON
Parse optional proof bytes from the query object and skip the outbound provider hook when proof is already attached (E2E and integrators).
This commit is contained in:
parent
df24c8e81c
commit
1f507d5875
@ -133,7 +133,7 @@ proc logosdelivery_store_query(
|
||||
let peer = peers.parsePeerInfo(($providerAddr).split(",")).valueOr:
|
||||
return err("StoreRequest failed to parse peer addr: " & $error)
|
||||
|
||||
if not providerCb.isNil:
|
||||
if storeQueryRequest.eligibilityProof.isNone and not providerCb.isNil:
|
||||
let canonicalHex = storeEligibilityCanonicalHex(storeQueryRequest)
|
||||
var outProof = newString(EligibilityOutProofHexMinLen)
|
||||
outProof.setLen(EligibilityOutProofHexMinLen)
|
||||
|
||||
@ -46,6 +46,14 @@ func storeQueryRequestFromJson*(
|
||||
else:
|
||||
none(uint64)
|
||||
|
||||
var eligibilityProof = none(seq[byte])
|
||||
if jsonContent.contains("eligibilityProofHex"):
|
||||
let proofHex = jsonContent["eligibilityProofHex"].getStr()
|
||||
eligibilityProof = try:
|
||||
some(proofHex.hexToSeqByte())
|
||||
except ValueError:
|
||||
return err("Failed converting eligibilityProofHex to bytes")
|
||||
|
||||
let startTime = ?jsonContent.getProtoInt64("timeStart")
|
||||
let endTime = ?jsonContent.getProtoInt64("timeEnd")
|
||||
|
||||
@ -61,5 +69,6 @@ func storeQueryRequestFromJson*(
|
||||
paginationCursor: paginationCursor,
|
||||
paginationForward: paginationForward,
|
||||
paginationLimit: paginationLimit,
|
||||
eligibilityProof: eligibilityProof,
|
||||
)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user