Skip to content

Commit

Permalink
Merge branch 'main' into feat/coin-selection-optout
Browse files Browse the repository at this point in the history
  • Loading branch information
cjkoepke authored Jan 31, 2025
2 parents 3af1f07 + 74465e6 commit 4de3510
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 12 deletions.
9 changes: 9 additions & 0 deletions packages/blaze-emulator/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @blaze-cardano/emulator

## 0.3.14

### Patch Changes

- Updated dependencies [bd6c264]
- Updated dependencies [bd6c264]
- @blaze-cardano/tx@0.10.4
- @blaze-cardano/wallet@0.3.9

## 0.3.13

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/blaze-emulator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blaze-cardano/emulator",
"version": "0.3.13",
"version": "0.3.14",
"description": "Blaze cardano emulator library",
"exports": {
".": {
Expand Down
11 changes: 11 additions & 0 deletions packages/blaze-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @blaze-cardano/sdk

## 0.2.20

### Patch Changes

- Updated dependencies [5472a55]
- Updated dependencies [bd6c264]
- Updated dependencies [bd6c264]
- @blaze-cardano/uplc@0.2.4
- @blaze-cardano/tx@0.10.4
- @blaze-cardano/wallet@0.3.9

## 0.2.19

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/blaze-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blaze-cardano/sdk",
"version": "0.2.19",
"version": "0.2.20",
"description": "Blaze cardano sdk library",
"exports": {
".": {
Expand Down
7 changes: 7 additions & 0 deletions packages/blaze-tx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @blaze-cardano/tx

## 0.10.4

### Patch Changes

- bd6c264: zero change outputs
- bd6c264: Zero change outputs

## 0.10.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/blaze-tx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blaze-cardano/tx",
"version": "0.10.3",
"version": "0.10.4",
"description": "Blaze cardano transaction building library",
"exports": {
".": {
Expand Down
11 changes: 4 additions & 7 deletions packages/blaze-tx/src/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,9 @@ export class TxBuilder {
* @param {Value} excessValue - The excess value that needs to be returned as change.
*/
private balanceChange(excessValue: Value) {
if (excessValue.coin() === 0n) {
return;
}
// Retrieve the multiasset map from the excess value.
const tokenMap = excessValue.multiasset();
// If the multiasset map exists, iterate over its keys.
Expand Down Expand Up @@ -1626,12 +1629,6 @@ export class TxBuilder {
excessValue = this.balanceMultiAssetChange(excessValue);
// Balance the change output with the updated excess value.
this.balanceChange(excessValue);
// Ensure a change output index has been set after balancing.
if (this.changeOutputIndex === undefined) {
throw new Error(
"Unreachable! Somehow change balancing succeeded but still failed.",
);
}
// Build the transaction witness set for fee estimation and script validation.
//excessValue = this.getPitch(false)
let tw = this.buildTransactionWitnessSet();
Expand Down Expand Up @@ -1722,7 +1719,7 @@ export class TxBuilder {

this.balanceChange(Value.fromCore(excessValue.toCore()));
const changeOutput = this.body.outputs()[this.changeOutputIndex!]!;
if (changeOutput.amount().coin() > excessValue.coin()) {
if (changeOutput && changeOutput.amount().coin() > excessValue.coin()) {
const excessDifference = value.merge(
changeOutput!.amount(),
value.negate(excessValue),
Expand Down
9 changes: 9 additions & 0 deletions packages/blaze-uplc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @blaze-cardano/uplc

## 0.2.4

### Patch Changes

- 5472a55: Export decoder/encoder
- Updated dependencies [bd6c264]
- Updated dependencies [bd6c264]
- @blaze-cardano/tx@0.10.4

## 0.2.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/blaze-uplc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blaze-cardano/uplc",
"version": "0.2.3",
"version": "0.2.4",
"description": "Blaze untyped plutus core library",
"exports": {
".": {
Expand Down
2 changes: 2 additions & 0 deletions packages/blaze-uplc/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/* Unfortunately no UPLC machine yet */
export * from "./utils";
export { UPLCDecoder } from "./decoder";
export { UPLCEncoder } from "./encoder";
8 changes: 8 additions & 0 deletions packages/blaze-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @blaze-cardano/wallet

## 0.3.9

### Patch Changes

- Updated dependencies [bd6c264]
- Updated dependencies [bd6c264]
- @blaze-cardano/tx@0.10.4

## 0.3.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/blaze-wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blaze-cardano/wallet",
"version": "0.3.8",
"version": "0.3.9",
"description": "Blaze cardano wallet library",
"exports": {
".": {
Expand Down

0 comments on commit 4de3510

Please sign in to comment.