Skip to content

Commit

Permalink
Tweak for accumulator witness updates
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed Jan 31, 2025
1 parent 34ed0b2 commit f4612f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/cheqd-blockchain-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @docknetwork/cheqd-blockchain-modules

## 0.25.0

### Minor Changes

- Tweak for accumulator witness updates

## 0.24.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/cheqd-blockchain-modules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/cheqd-blockchain-modules",
"version": "0.24.0",
"version": "0.25.0",
"type": "module",
"license": "MIT",
"main": "./dist/esm/index.js",
Expand Down
9 changes: 9 additions & 0 deletions packages/cheqd-blockchain-modules/src/accumulator/internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ export default class CheqdInternalAccumulatorModule extends injectParams(
).ids();

const startIdx = sortedIDs.findIndex((id) => id === startUUID);
if (startIdx === -1) {
throw new Error(
`Accumulator \`${accumulatorId}\` with version \`${startUUID}\` doesn't exist`,
);
}
let endIdx;
if (end != null) {
endIdx = sortedIDs.findIndex((id) => id === endUUID);
Expand All @@ -307,6 +312,10 @@ export default class CheqdInternalAccumulatorModule extends injectParams(
const { additions, removals, witnessUpdateInfo } = CheqdStoredAccumulator.from(
validateResource(accumulator, String(name), Type),
);
if (witnessUpdateInfo == null) {
// eslint-disable-next-line no-continue
continue;
}

witness.updateUsingPublicInfoPostBatchUpdate(
member,
Expand Down

0 comments on commit f4612f2

Please sign in to comment.