@indigo-labs/indigo-sdk 0.1.20 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/.github/workflows/ci.yml +3 -8
  2. package/.github/workflows/test.yml +44 -0
  3. package/dist/index.d.mts +678 -1001
  4. package/dist/index.d.ts +678 -1001
  5. package/dist/index.js +2272 -4670
  6. package/dist/index.mjs +2234 -4618
  7. package/eslint.config.mjs +1 -7
  8. package/package.json +4 -9
  9. package/src/contracts/cdp.ts +746 -0
  10. package/src/contracts/collector.ts +98 -0
  11. package/src/contracts/gov.ts +1 -0
  12. package/src/contracts/interest-oracle.ts +149 -0
  13. package/src/contracts/{lrp/transactions.ts → lrp.ts} +14 -14
  14. package/src/contracts/{one-shot/transactions.ts → one-shot.ts} +3 -3
  15. package/src/contracts/stability-pool.ts +690 -0
  16. package/src/contracts/staking.ts +348 -0
  17. package/src/contracts/treasury.ts +112 -0
  18. package/src/helpers/asset-helpers.ts +57 -0
  19. package/src/{utils → helpers}/helper-txs.ts +0 -1
  20. package/src/{utils/utils.ts → helpers/helpers.ts} +10 -0
  21. package/src/{contracts/interest-oracle/helpers.ts → helpers/interest-oracle.ts} +9 -37
  22. package/src/{contracts/stability-pool/helpers.ts → helpers/stability-pool-helpers.ts} +6 -110
  23. package/src/helpers/staking-helpers.ts +94 -0
  24. package/src/helpers/time-helpers.ts +4 -0
  25. package/src/{utils → helpers}/value-helpers.ts +0 -10
  26. package/src/index.ts +33 -37
  27. package/src/{validators → scripts}/cdp-creator-validator.ts +50 -4
  28. package/src/{validators → scripts}/cdp-validator.ts +5 -3
  29. package/src/{validators → scripts}/collector-validator.ts +3 -2
  30. package/src/scripts/execute-validator.ts +52 -0
  31. package/src/{validators/governance-validator.ts → scripts/gov-validator.ts} +40 -3
  32. package/src/{validators → scripts}/interest-oracle-validator.ts +20 -4
  33. package/src/scripts/lrp-validator.ts +40 -0
  34. package/src/{contracts/one-shot/scripts.ts → scripts/one-shot-policy.ts} +1 -1
  35. package/src/scripts/poll-manager-validator.ts +52 -0
  36. package/src/{validators → scripts}/poll-shard-validator.ts +43 -3
  37. package/src/{contracts/price-oracle/scripts.ts → scripts/price-oracle-validator.ts} +4 -1
  38. package/src/{validators → scripts}/stability-pool-validator.ts +57 -4
  39. package/src/{validators → scripts}/staking-validator.ts +3 -2
  40. package/src/{validators → scripts}/treasury-validator.ts +3 -2
  41. package/src/{validators → scripts}/version-record-policy.ts +23 -4
  42. package/src/{validators/execute-validator.ts → scripts/version-registry.ts} +11 -3
  43. package/src/types/generic.ts +60 -78
  44. package/src/{contracts/cdp-creator/types.ts → types/indigo/cdp-creator.ts} +4 -6
  45. package/src/types/indigo/cdp.ts +88 -0
  46. package/src/types/indigo/execute.ts +21 -0
  47. package/src/types/indigo/gov.ts +51 -0
  48. package/src/{contracts/interest-oracle/types.ts → types/indigo/interest-oracle.ts} +1 -1
  49. package/src/{contracts/lrp/types.ts → types/indigo/lrp.ts} +2 -2
  50. package/src/types/indigo/poll-manager.ts +21 -0
  51. package/src/types/indigo/poll-shard.ts +16 -0
  52. package/src/{contracts/price-oracle/types.ts → types/indigo/price-oracle.ts} +4 -16
  53. package/src/types/indigo/stability-pool.ts +233 -0
  54. package/src/types/indigo/staking.ts +99 -0
  55. package/src/{contracts/version-registry/types.ts → types/indigo/version-record.ts} +1 -1
  56. package/src/types/on-chain-decimal.ts +0 -22
  57. package/src/types/system-params.ts +11 -22
  58. package/tests/datums.test.ts +108 -125
  59. package/tests/endpoints/initialize.ts +338 -240
  60. package/tests/hash-checks.test.ts +21 -26
  61. package/tests/indigo-test-helpers.ts +55 -1
  62. package/tests/initialize.test.ts +5 -10
  63. package/tests/interest-calculations.test.ts +18 -18
  64. package/tests/interest-oracle.test.ts +18 -20
  65. package/tests/lrp.test.ts +65 -191
  66. package/tests/queries/governance-queries.ts +16 -19
  67. package/tests/queries/iasset-queries.ts +23 -46
  68. package/tests/queries/interest-oracle-queries.ts +6 -3
  69. package/tests/queries/lrp-queries.ts +2 -2
  70. package/tests/queries/price-oracle-queries.ts +22 -5
  71. package/tests/queries/stability-pool-queries.ts +8 -10
  72. package/tests/queries/staking-queries.ts +19 -28
  73. package/tests/stability-pool.test.ts +71 -186
  74. package/tests/staking.test.ts +23 -30
  75. package/tests/test-helpers.ts +2 -11
  76. package/tsconfig.json +1 -3
  77. package/vitest.config.ts +1 -1
  78. package/src/contracts/cdp/helpers.ts +0 -167
  79. package/src/contracts/cdp/scripts.ts +0 -33
  80. package/src/contracts/cdp/transactions.ts +0 -1310
  81. package/src/contracts/cdp/types.ts +0 -161
  82. package/src/contracts/cdp-creator/scripts.ts +0 -39
  83. package/src/contracts/collector/scripts.ts +0 -32
  84. package/src/contracts/collector/transactions.ts +0 -44
  85. package/src/contracts/execute/scripts.ts +0 -48
  86. package/src/contracts/execute/types.ts +0 -57
  87. package/src/contracts/gov/helpers.ts +0 -157
  88. package/src/contracts/gov/scripts.ts +0 -34
  89. package/src/contracts/gov/transactions.ts +0 -1224
  90. package/src/contracts/gov/types-new.ts +0 -115
  91. package/src/contracts/gov/types.ts +0 -89
  92. package/src/contracts/interest-oracle/scripts.ts +0 -18
  93. package/src/contracts/interest-oracle/transactions.ts +0 -149
  94. package/src/contracts/lrp/scripts.ts +0 -27
  95. package/src/contracts/poll/helpers.ts +0 -55
  96. package/src/contracts/poll/scripts.ts +0 -72
  97. package/src/contracts/poll/types-poll-manager.ts +0 -38
  98. package/src/contracts/poll/types-poll-shard.ts +0 -38
  99. package/src/contracts/poll/types-poll.ts +0 -88
  100. package/src/contracts/price-oracle/transactions.ts +0 -112
  101. package/src/contracts/stability-pool/scripts.ts +0 -46
  102. package/src/contracts/stability-pool/transactions.ts +0 -660
  103. package/src/contracts/stability-pool/types-new.ts +0 -208
  104. package/src/contracts/stability-pool/types.ts +0 -42
  105. package/src/contracts/staking/helpers.ts +0 -116
  106. package/src/contracts/staking/scripts.ts +0 -41
  107. package/src/contracts/staking/transactions.ts +0 -268
  108. package/src/contracts/staking/types-new.ts +0 -81
  109. package/src/contracts/staking/types.ts +0 -41
  110. package/src/contracts/treasury/scripts.ts +0 -37
  111. package/src/contracts/treasury/transactions.ts +0 -44
  112. package/src/contracts/treasury/types.ts +0 -55
  113. package/src/contracts/version-registry/scripts.ts +0 -29
  114. package/src/contracts/version-registry/types-new.ts +0 -19
  115. package/src/contracts/vesting/helpers.ts +0 -267
  116. package/src/types/evolution-schema-options.ts +0 -16
  117. package/src/utils/bigint-utils.ts +0 -7
  118. package/src/utils/time-helpers.ts +0 -4
  119. package/src/validators/lrp-validator.ts +0 -7
  120. package/src/validators/poll-manager-validator.ts +0 -7
  121. package/src/validators/version-registry-validator.ts +0 -7
  122. package/tests/cdp.test.ts +0 -1565
  123. package/tests/gov.test.ts +0 -1874
  124. package/tests/mock/assets-mock.ts +0 -59
  125. package/tests/queries/cdp-queries.ts +0 -144
  126. package/tests/queries/collector-queries.ts +0 -26
  127. package/tests/queries/execute-queries.ts +0 -46
  128. package/tests/queries/poll-queries.ts +0 -97
  129. package/tests/queries/treasury-queries.ts +0 -19
  130. package/tests/utils/asserts.ts +0 -13
  131. package/tests/utils/index.ts +0 -50
  132. /package/src/{utils → helpers}/indigo-helpers.ts +0 -0
  133. /package/src/{utils → helpers}/lucid-utils.ts +0 -0
  134. /package/src/{contracts/price-oracle/helpers.ts → helpers/price-oracle-helpers.ts} +0 -0
  135. /package/src/{contracts/one-shot/types.ts → types/one-shot.ts} +0 -0
@@ -1,17 +1,16 @@
1
1
  import { describe, expect, it } from 'vitest';
2
2
  import {
3
3
  loadSystemParamsFromFile,
4
+ StakingContract,
5
+ CollectorContract,
6
+ CDPContract,
4
7
  mkCDPCreatorValidatorFromSP,
5
8
  mkInterestOracleValidator,
6
9
  mkLrpValidatorFromSP,
7
- mkCdpValidatorFromSP,
8
- mkExecuteValidatorFromSP,
9
- mkCollectorValidatorFromSP,
10
10
  } from '../src';
11
11
  import { validatorToScriptHash } from '@lucid-evolution/lucid';
12
- import { mkStabilityPoolValidatorFromSP } from '../src/contracts/stability-pool/scripts';
13
- import { mkGovValidatorFromSP } from '../src/contracts/gov/scripts';
14
- import { mkStakingValidatorFromSP } from '../src/contracts/staking/scripts';
12
+ import { mkStabilityPoolValidatorFromSP } from '../src/scripts/stability-pool-validator';
13
+ import { mkGovValidatorFromSP } from '../src/scripts/gov-validator';
15
14
 
16
15
  const systemParams = loadSystemParamsFromFile(
17
16
  './tests/data/system-params.json',
@@ -26,37 +25,33 @@ describe('Validator Hash checks', () => {
26
25
  ).toBe(systemParams.validatorHashes.cdpCreatorHash);
27
26
  });
28
27
  it('CDP validator hash', () => {
29
- expect(
30
- validatorToScriptHash(mkCdpValidatorFromSP(systemParams.cdpParams)),
31
- ).toBe(systemParams.validatorHashes.cdpHash);
28
+ expect(CDPContract.validatorHash(systemParams.cdpParams)).toBe(
29
+ systemParams.validatorHashes.cdpHash,
30
+ );
32
31
  });
33
32
  it('Collector validator hash', () => {
34
- expect(
35
- validatorToScriptHash(
36
- mkCollectorValidatorFromSP(systemParams.collectorParams),
37
- ),
38
- ).toBe(systemParams.validatorHashes.collectorHash);
33
+ expect(CollectorContract.validatorHash(systemParams.collectorParams)).toBe(
34
+ systemParams.validatorHashes.collectorHash,
35
+ );
39
36
  });
40
37
  // TODO: Revisit this test, issues with cbor encoding on Lucid?
41
38
  // Applying parameters to the validator using `aiken build` does not result in the same hash as the one generate by Lucid.
42
- it.todo('Execute validator hash', () => {
43
- expect(
44
- validatorToScriptHash(
45
- mkExecuteValidatorFromSP(systemParams.executeParams),
46
- ),
47
- ).toBe(systemParams.validatorHashes.executeHash);
48
- });
39
+ // it('Execute validator hash', () => {
40
+ // expect(
41
+ // validatorToScriptHash(mkExecuteValidatorFromSP(systemParams.executeParams)),
42
+ // ).toBe(
43
+ // systemParams.validatorHashes.executeHash,
44
+ // );
45
+ // });
49
46
  it('Gov validator hash', () => {
50
47
  expect(
51
48
  validatorToScriptHash(mkGovValidatorFromSP(systemParams.govParams)),
52
49
  ).toBe(systemParams.validatorHashes.govHash);
53
50
  });
54
51
  it('Staking validator hash', () => {
55
- expect(
56
- validatorToScriptHash(
57
- mkStakingValidatorFromSP(systemParams.stakingParams),
58
- ),
59
- ).toBe(systemParams.validatorHashes.stakingHash);
52
+ expect(StakingContract.validatorHash(systemParams.stakingParams)).toBe(
53
+ systemParams.validatorHashes.stakingHash,
54
+ );
60
55
  });
61
56
  it('Stability Pool validator hash', () => {
62
57
  expect(
@@ -6,13 +6,67 @@ import {
6
6
  ScriptHash,
7
7
  toUnit,
8
8
  } from '@lucid-evolution/lucid';
9
- import { createScriptAddress } from '../src/utils/lucid-utils';
9
+ import { createScriptAddress } from '../src/helpers/lucid-utils';
10
10
  import {
11
11
  AssetClass,
12
12
  IAssetContent,
13
+ OracleAssetNft,
14
+ PriceOracleParams,
13
15
  runOneShotMintTx,
14
16
  serialiseIAssetDatum,
17
+ serialisePriceOracleDatum,
15
18
  } from '../src';
19
+ import { OnChainDecimal } from '../src/types/on-chain-decimal';
20
+
21
+ export async function runStartPriceOracle(
22
+ lucid: LucidEvolution,
23
+ oracleScriptHash: ScriptHash,
24
+ oracleParams: PriceOracleParams,
25
+ network: Network,
26
+ // Hex encoded
27
+ oracleNftTokenName: string,
28
+ price: OnChainDecimal,
29
+ ): Promise<OracleAssetNft> {
30
+ const utxos = await lucid.wallet().getUtxos();
31
+
32
+ const nftPolicyId = await runOneShotMintTx(lucid, {
33
+ referenceOutRef: {
34
+ txHash: utxos[0].txHash,
35
+ outputIdx: BigInt(utxos[0].outputIndex),
36
+ },
37
+ mintAmounts: [{ tokenName: oracleNftTokenName, amount: 1n }],
38
+ });
39
+
40
+ const nftValue: Assets = { [toUnit(nftPolicyId, oracleNftTokenName)]: 1n };
41
+
42
+ const txHash = await lucid
43
+ .newTx()
44
+ .pay.ToContract(
45
+ createScriptAddress(network, oracleScriptHash),
46
+ {
47
+ kind: 'inline',
48
+ value: serialisePriceOracleDatum({
49
+ price: price,
50
+ expiration: BigInt(Date.now()) + oracleParams.expiration,
51
+ }),
52
+ },
53
+ nftValue,
54
+ )
55
+ .complete()
56
+ .then((tx) => tx.sign.withWallet().complete())
57
+ .then((tx) => tx.submit());
58
+
59
+ await lucid.awaitTx(txHash);
60
+
61
+ return {
62
+ oracleNft: {
63
+ asset: {
64
+ currencySymbol: nftPolicyId,
65
+ tokenName: oracleNftTokenName,
66
+ },
67
+ },
68
+ };
69
+ }
16
70
 
17
71
  /**
18
72
  * TODO: the NFT has to be minted using the auth policy based on execute NFT.
@@ -1,16 +1,11 @@
1
1
  import { beforeEach, test } from 'vitest';
2
2
  import { LucidContext } from './test-helpers';
3
- import { EmulatorAccount, Lucid } from '@lucid-evolution/lucid';
3
+ import { Lucid } from '@lucid-evolution/lucid';
4
4
  import { Emulator } from '@lucid-evolution/lucid';
5
5
  import { generateEmulatorAccount } from '@lucid-evolution/lucid';
6
6
  import { init } from './endpoints/initialize';
7
- import { iusdInitialAssetCfg } from './mock/assets-mock';
8
7
 
9
- type MyContext = LucidContext<{
10
- admin: EmulatorAccount;
11
- }>;
12
-
13
- beforeEach<MyContext>(async (context: MyContext) => {
8
+ beforeEach<LucidContext>(async (context: LucidContext) => {
14
9
  context.users = {
15
10
  admin: generateEmulatorAccount({
16
11
  lovelace: BigInt(100_000_000_000_000),
@@ -22,11 +17,11 @@ beforeEach<MyContext>(async (context: MyContext) => {
22
17
  context.lucid = await Lucid(context.emulator, 'Custom');
23
18
  });
24
19
 
25
- test<MyContext>('Initialize Protocol - can initialize', async ({
20
+ test<LucidContext>('Initialize Protocol - can initialize', async ({
26
21
  lucid,
27
22
  users,
28
- }: MyContext) => {
23
+ }: LucidContext) => {
29
24
  lucid.selectWallet.fromSeed(users.admin.seedPhrase);
30
25
 
31
- await init(lucid, [iusdInitialAssetCfg]);
26
+ await init(lucid);
32
27
  });
@@ -1,25 +1,25 @@
1
1
  import { describe, expect, it } from 'vitest';
2
- import { ONE_DAY } from '../src/utils/time-helpers';
2
+ import { oneDay } from '../src/helpers/time-helpers';
3
3
  import {
4
4
  calculateAccruedInterest,
5
5
  calculateUnitaryInterestSinceOracleLastUpdated,
6
- } from '../src/contracts/interest-oracle/helpers';
6
+ } from '../src/helpers/interest-oracle';
7
7
 
8
8
  describe('Interest Calculations', () => {
9
9
  describe('Calculate Unitary Interest', () => {
10
10
  it('Should calculate the unitary interest correctly, 0', () => {
11
11
  expect(
12
- calculateUnitaryInterestSinceOracleLastUpdated(ONE_DAY * 6n, {
12
+ calculateUnitaryInterestSinceOracleLastUpdated(oneDay * 6n, {
13
13
  unitaryInterest: 684_931_506_849_315n,
14
14
  interestRate: { getOnChainInt: 100_000n },
15
- lastUpdated: ONE_DAY * 5n,
15
+ lastUpdated: oneDay * 5n,
16
16
  }),
17
17
  ).toBe(273_972_602_739_726n);
18
18
  });
19
19
 
20
20
  it('Should calculate the unitary interest correctly, 1', () => {
21
21
  expect(
22
- calculateUnitaryInterestSinceOracleLastUpdated(ONE_DAY * 6n, {
22
+ calculateUnitaryInterestSinceOracleLastUpdated(oneDay * 6n, {
23
23
  unitaryInterest: 0n,
24
24
  interestRate: { getOnChainInt: 50_000n },
25
25
  lastUpdated: 0n,
@@ -41,7 +41,7 @@ describe('Interest Calculations', () => {
41
41
  describe('Calculate Accumulated Interest', () => {
42
42
  it('Should calculate the accumulated interest correctly, 0', () => {
43
43
  expect(
44
- calculateAccruedInterest(ONE_DAY, 0n, 1_000_000n, 0n, {
44
+ calculateAccruedInterest(oneDay, 0n, 1_000_000n, 0n, {
45
45
  unitaryInterest: 0n,
46
46
  interestRate: { getOnChainInt: 50_000n },
47
47
  lastUpdated: 0n,
@@ -51,20 +51,20 @@ describe('Interest Calculations', () => {
51
51
 
52
52
  it('Should calculate the accumulated interest correctly, 1', () => {
53
53
  expect(
54
- calculateAccruedInterest(ONE_DAY * 6n, 0n, 1_000_000n, 0n, {
54
+ calculateAccruedInterest(oneDay * 6n, 0n, 1_000_000n, 0n, {
55
55
  unitaryInterest: 684_931_506_849_315n,
56
56
  interestRate: { getOnChainInt: 100_000n },
57
- lastUpdated: ONE_DAY * 5n,
57
+ lastUpdated: oneDay * 5n,
58
58
  }),
59
59
  ).toBe(684n + 273n);
60
60
  });
61
61
 
62
62
  it('Should calculate the accumulated interest correctly, 2', () => {
63
63
  expect(
64
- calculateAccruedInterest(ONE_DAY * 17n, 0n, 1_000_000n, 0n, {
64
+ calculateAccruedInterest(oneDay * 17n, 0n, 1_000_000n, 0n, {
65
65
  unitaryInterest: 1_506_849_315_068_493n,
66
66
  interestRate: { getOnChainInt: 100_000n },
67
- lastUpdated: ONE_DAY * 15n,
67
+ lastUpdated: oneDay * 15n,
68
68
  }),
69
69
  ).toBe(1506n + 547n);
70
70
  });
@@ -72,14 +72,14 @@ describe('Interest Calculations', () => {
72
72
  it('Should calculate the accumulated interest correctly, 3', () => {
73
73
  expect(
74
74
  calculateAccruedInterest(
75
- ONE_DAY * 17n,
75
+ oneDay * 17n,
76
76
  410_958_904_109_589n,
77
77
  1_000_000n,
78
- ONE_DAY * 3n,
78
+ oneDay * 3n,
79
79
  {
80
80
  unitaryInterest: 1_506_849_315_068_493n,
81
81
  interestRate: { getOnChainInt: 100_000n },
82
- lastUpdated: ONE_DAY * 15n,
82
+ lastUpdated: oneDay * 15n,
83
83
  },
84
84
  ),
85
85
  ).toBe(1095n + 547n);
@@ -88,14 +88,14 @@ describe('Interest Calculations', () => {
88
88
  it('Should calculate the accumulated interest correctly, 4', () => {
89
89
  expect(
90
90
  calculateAccruedInterest(
91
- ONE_DAY * 17n,
91
+ oneDay * 17n,
92
92
  767_123_287_671_232n,
93
93
  1_000_000n,
94
- ONE_DAY * 6n,
94
+ oneDay * 6n,
95
95
  {
96
96
  unitaryInterest: 1_506_849_315_068_493n,
97
97
  interestRate: { getOnChainInt: 100_000n },
98
- lastUpdated: ONE_DAY * 15n,
98
+ lastUpdated: oneDay * 15n,
99
99
  },
100
100
  ),
101
101
  ).toBe(739n + 547n);
@@ -104,10 +104,10 @@ describe('Interest Calculations', () => {
104
104
  it('Should calculate the accumulated interest correctly, 5', () => {
105
105
  expect(
106
106
  calculateAccruedInterest(
107
- ONE_DAY * 10n,
107
+ oneDay * 10n,
108
108
  821_917_808_219_178n,
109
109
  1_000_000n,
110
- ONE_DAY * 6n,
110
+ oneDay * 6n,
111
111
  {
112
112
  unitaryInterest: 0n,
113
113
  interestRate: { getOnChainInt: 50_000n },
@@ -4,24 +4,16 @@ import {
4
4
  runAndAwaitTx,
5
5
  runAndAwaitTxBuilder,
6
6
  } from './test-helpers';
7
- import { EmulatorAccount, Lucid } from '@lucid-evolution/lucid';
7
+ import { Lucid } from '@lucid-evolution/lucid';
8
8
  import { Emulator } from '@lucid-evolution/lucid';
9
9
  import { generateEmulatorAccount } from '@lucid-evolution/lucid';
10
- import { addrDetails } from '../src/utils/lucid-utils';
11
- import {
12
- feedInterestOracle,
13
- InterestOracleParams,
14
- startInterestOracle,
15
- } from '../src';
10
+ import { addrDetails } from '../src/helpers/lucid-utils';
11
+ import { InterestOracleContract, InterestOracleParams } from '../src';
16
12
  import { findInterestOracle } from './queries/interest-oracle-queries';
17
13
 
18
- type MyContext = LucidContext<{
19
- user: EmulatorAccount;
20
- }>;
21
-
22
14
  let originalDateNow: () => number;
23
15
 
24
- beforeEach<MyContext>(async (context: MyContext) => {
16
+ beforeEach<LucidContext>(async (context: LucidContext) => {
25
17
  context.users = {
26
18
  user: generateEmulatorAccount({
27
19
  lovelace: BigInt(100_000_000_000_000),
@@ -40,15 +32,15 @@ afterEach(() => {
40
32
  Date.now = originalDateNow;
41
33
  });
42
34
 
43
- test<MyContext>('Interest Oracle - Start', async ({
35
+ test<LucidContext>('Interest Oracle - Start', async ({
44
36
  lucid,
45
37
  users,
46
- }: MyContext) => {
38
+ }: LucidContext) => {
47
39
  lucid.selectWallet.fromSeed(users.user.seedPhrase);
48
40
 
49
41
  const [pkh, _] = await addrDetails(lucid);
50
42
 
51
- const [tx, _ac] = await startInterestOracle(
43
+ const [tx, _ac] = await InterestOracleContract.startInterestOracle(
52
44
  0n,
53
45
  0n,
54
46
  0n,
@@ -62,10 +54,10 @@ test<MyContext>('Interest Oracle - Start', async ({
62
54
  await runAndAwaitTxBuilder(lucid, tx);
63
55
  });
64
56
 
65
- test<MyContext>('Interest Oracle - Update', async ({
57
+ test<LucidContext>('Interest Oracle - Update', async ({
66
58
  lucid,
67
59
  users,
68
- }: MyContext) => {
60
+ }: LucidContext) => {
69
61
  lucid.selectWallet.fromSeed(users.user.seedPhrase);
70
62
 
71
63
  const [pkh, _] = await addrDetails(lucid);
@@ -74,7 +66,7 @@ test<MyContext>('Interest Oracle - Update', async ({
74
66
  owner: pkh.hash,
75
67
  };
76
68
 
77
- const [tx, assetClass] = await startInterestOracle(
69
+ const [tx, assetClass] = await InterestOracleContract.startInterestOracle(
78
70
  0n,
79
71
  0n,
80
72
  0n,
@@ -84,9 +76,15 @@ test<MyContext>('Interest Oracle - Update', async ({
84
76
 
85
77
  await runAndAwaitTxBuilder(lucid, tx);
86
78
 
87
- const utxo = await findInterestOracle(lucid, assetClass);
79
+ const [utxo, _datum] = await findInterestOracle(lucid, assetClass);
88
80
  await runAndAwaitTx(
89
81
  lucid,
90
- feedInterestOracle(interestParams, 500_000n, lucid, undefined, utxo),
82
+ InterestOracleContract.feedInterestOracle(
83
+ interestParams,
84
+ 500_000n,
85
+ lucid,
86
+ undefined,
87
+ utxo,
88
+ ),
91
89
  );
92
90
  });