Skip to content

Remove manual minLovelace calculation now that SDK returns correct value#40

Merged
SynthLuvr merged 2 commits into
mainfrom
copilot/remove-minlovelace-calculation
Mar 2, 2026
Merged

Remove manual minLovelace calculation now that SDK returns correct value#40
SynthLuvr merged 2 commits into
mainfrom
copilot/remove-minlovelace-calculation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

calculateMinimumUtxoLovelace previously omitted the 160-byte UTxO entry overhead from its result, requiring a manual workaround. IntersectMBO/evolution-sdk#169 fixes this, making the workaround unnecessary.

Changes

  • src/mint.ts: Remove the manual (cborSize + 160n) * coinsPerUtxoByte calculation and pass the actual coinsPerUtxoByte directly to calculateMinimumUtxoLovelace, using its result as minLovelace.

Before:

const cborSize = await Effect.runPromise(
  calculateMinimumUtxoLovelace({ ..., coinsPerUtxoByte: 1n })
);
const minLovelace = (cborSize + 160n) * coinsPerUtxoByte;

After:

const minLovelace = await Effect.runPromise(
  calculateMinimumUtxoLovelace({ ..., coinsPerUtxoByte })
);

The 1 ADA lovelace placeholder is retained to ensure consistent 5-byte CBOR encoding of the lovelace field.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove minLovelace calculation in mint.ts Remove manual minLovelace calculation now that SDK returns correct value Mar 2, 2026
@SynthLuvr SynthLuvr marked this pull request as ready for review March 2, 2026 15:21
@SynthLuvr SynthLuvr merged commit a5ed9e7 into main Mar 2, 2026
1 check passed
@SynthLuvr SynthLuvr deleted the copilot/remove-minlovelace-calculation branch March 2, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants