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
16 changes: 16 additions & 0 deletions src/fixtures/mainnet/scripts/hash-redeemers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { expect } from 'vitest';
import { getPaginationFixtures } from '../../../index.js';

const paginationFixtures = getPaginationFixtures(
Expand Down Expand Up @@ -97,4 +98,19 @@ export default [
},
],
},
{
// the constitution guardrails script (fa24fb30…) has executed on every
// enacted parameter change and treasury withdrawal, but db-sync leaves
// propose redeemers unattributed, so the API finds no rows for it. a
// backend that attributes governance redeemers from the ledger lists
// those executions here. an empty page and propose-only rows both
// pass; any other purpose under this script fails.
id: 'scripts-hash-redeemers-guardrails-unattributed_f0c6fbe97beb',
testName: 'scripts/:hash/redeemers guardrails script governance executions',
endpoints: ['scripts/fa24fb305126805cf2164c161d852a0e7330cf988f1fe558cf7d4a64/redeemers'],
response: expect.toSatisfy(
(rows: { purpose: string }[]) =>
Array.isArray(rows) && rows.every(row => row.purpose === 'propose'),
),
},
];
26 changes: 26 additions & 0 deletions src/fixtures/mainnet/txs/tx-redeemers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,30 @@ export default [
},
]),
},
{
// a mainnet parameter-change proposal: the constitution guardrails
// script executes with a propose redeemer. pins two current-API facts:
// the propose row is served ahead of the published schema, and
// script_hash is empty — db-sync does not attribute governance
// redeemers; a ledger-attributing backend returns the guardrails hash.
// both are accepted; any other value fails.
id: 'txs-redeemers-propose-purpose_c48e858a027e',
testName: 'txs/:hash/redeemers with a propose redeemer',
endpoints: ['txs/51f495aa23f4b3b3aa90afde4a0e67823bb7ac4ac65f5ffbb138373b863f2f74/redeemers'],
response: [
{
tx_index: 0,
purpose: 'propose',
script_hash: expect.toBeOneOf([
'',
'fa24fb305126805cf2164c161d852a0e7330cf988f1fe558cf7d4a64',
]),
redeemer_data_hash: 'd36a2619a672494604e11bb447cbcf5231e9f2ba25c2169177edc941bd50ad6c',
datum_hash: 'd36a2619a672494604e11bb447cbcf5231e9f2ba25c2169177edc941bd50ad6c',
unit_mem: '478665',
unit_steps: '104574320',
fee: '35159',
},
],
},
];
Loading
Loading