Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions registry/src/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ export class HttpLedgerClient implements LedgerClient {
method: 'POST',
headers: this.headers(),
body: JSON.stringify({
filter: templateFilter(templateId, party, includeCreatedEventBlob),
verbose: false,
eventFormat: {
...templateFilter(templateId, party, includeCreatedEventBlob),
verbose: false,
},
activeAtOffset,
}),
})
Expand Down
8 changes: 5 additions & 3 deletions registry/test/ledger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ describe('HttpLedgerClient.activeContracts', () => {
expect(url).toBe('http://ledger/v2/state/active-contracts')
expect(init.method).toBe('POST')
const body = JSON.parse(init.body as string)
expect(body).not.toHaveProperty('filter')
expect(body).not.toHaveProperty('verbose')
expect(
body.filter.filtersByParty['admin::1'].cumulative[0].identifierFilter.TemplateFilter.value
.templateId,
body.eventFormat.filtersByParty['admin::1'].cumulative[0].identifierFilter.TemplateFilter
.value.templateId,
).toBe('pkg:Canton.TokenForge.Registry:InstrumentConfig')
})

Expand Down Expand Up @@ -191,7 +193,7 @@ describe('HttpLedgerClient.probeTemplate', () => {
expect(body.activeAtOffset).toBe(0)
// And no disclosure blob, which is the bulk of a row and is what a
// counterparty needs rather than a check that reads nothing back.
const filter = body.filter.filtersByParty['admin::1'].cumulative[0].identifierFilter
const filter = body.eventFormat.filtersByParty['admin::1'].cumulative[0].identifierFilter
expect(filter.TemplateFilter.value).toEqual({
templateId: 'pkg:M:LockedToken',
includeCreatedEventBlob: false,
Expand Down
4 changes: 2 additions & 2 deletions scripts/seed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ async function ledgerEnd() {

async function activeContracts(templateId, party) {
const rows = await call('/v2/state/active-contracts', {
filter: {
eventFormat: {
filtersByParty: {
[party]: {
cumulative: [
Expand All @@ -177,8 +177,8 @@ async function activeContracts(templateId, party) {
],
},
},
verbose: false,
},
verbose: false,
activeAtOffset: await ledgerEnd(),
})
return rows.flatMap((row) => {
Expand Down
Loading