Skip to content

Commit a53138c

Browse files
committed
increment spf
1 parent ca37e44 commit a53138c

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/components/Indexer/processor.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,16 @@ class BaseEventProcessor {
247247
const { nonce: nonceDB } = await getDatabase()
248248
const nonceHandlerResponse = await getNonce(nonceDB, eventCreator)
249249
const nonce = await streamToString(nonceHandlerResponse.stream as Readable)
250+
const incrementedNonce = (Number(nonce) + 1).toString()
251+
250252
const config = await getConfiguration()
251253
const { keys } = config
252254
const nodeId = keys.peerId.toString()
253255

254256
const wallet: ethers.Wallet = new ethers.Wallet(process.env.PRIVATE_KEY as string)
255257

256258
const message = String(
257-
txId + contractAddress + keys.ethAddress + chainId.toString() + nonce
259+
txId + contractAddress + keys.ethAddress + chainId.toString() + incrementedNonce
258260
)
259261
const consumerMessage = ethers.solidityPackedKeccak256(
260262
['bytes'],
@@ -270,7 +272,7 @@ class BaseEventProcessor {
270272
decrypterAddress: keys.ethAddress,
271273
dataNftAddress: contractAddress,
272274
signature,
273-
nonce
275+
nonce: incrementedNonce
274276
}
275277
const response = await axios({
276278
method: 'post',
@@ -313,7 +315,7 @@ class BaseEventProcessor {
313315
documentHash: metadataHash,
314316
dataNftAddress: contractAddress,
315317
signature,
316-
nonce
318+
nonce: incrementedNonce
317319
}
318320
try {
319321
const response = await node
@@ -374,7 +376,7 @@ class BaseEventProcessor {
374376
documentHash: metadataHash,
375377
dataNftAddress: contractAddress,
376378
signature,
377-
nonce
379+
nonce: incrementedNonce
378380
}
379381
const response = await p2pNode.sendTo(
380382
decryptorURL,

src/components/core/handler/feesHandler.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,15 @@ export class FeesHandler extends CommandHandler {
100100
const nonceDB = this.getOceanNode().getDatabase().nonce
101101
const nonceHandlerResponse = await getNonce(nonceDB, task.consumerAddress)
102102
const nonce = await streamToString(nonceHandlerResponse.stream as Readable)
103+
const incrementedNonce = (Number(nonce) + 1).toString()
103104

104105
try {
105106
const providerFee = await createProviderFee(ddo, service, validUntil)
106107
if (providerFee) {
107108
const response: ProviderInitialize = {
108109
providerFee,
109110
datatoken: service?.datatokenAddress,
110-
nonce,
111+
nonce: incrementedNonce,
111112
computeAddress: task?.consumerAddress
112113
}
113114
return {

0 commit comments

Comments
 (0)