Skip to content

Commit ac39e77

Browse files
AngelCastilloBmkazlauskas
authored andcommitted
fix(input-selection): fixed recursive use of CSL object
1 parent 0624a0b commit ac39e77

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: packages/core/src/CML/util.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/* eslint-disable prettier/prettier */
22
import { BigNum } from '@dcspark/cardano-multiplatform-lib-nodejs';
33
import { CML } from './CML';
4-
import { HexBlob } from '../Cardano/util/primitives';
5-
import { Tx, TxBody } from '../Cardano/types';
4+
import { HexBlob } from '../Cardano/util';
5+
import { ManagedFreeableScope, usingAutoFree } from '@cardano-sdk/util';
6+
import { Tx, TxBody } from '../Cardano';
67
import { newTx } from './cmlToCore';
7-
import { usingAutoFree } from '@cardano-sdk/util';
88

99
export const MAX_U64 = 18_446_744_073_709_551_615n;
1010

1111
export const MIN_I64 = -9_223_372_036_854_775_808n;
1212
export const MAX_I64 = 9_223_372_036_854_775_807n;
1313

14-
export const maxBigNum = BigNum.from_str(MAX_U64.toString());
14+
export const maxBigNum = (scope: ManagedFreeableScope) => scope.manage(BigNum.from_str(MAX_U64.toString()));
1515

1616
export type CslObject = { to_bytes: () => Uint8Array };
1717

Diff for: packages/input-selection/src/selectionConstraints.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const tokenBundleSizeExceedsLimit =
7272
return false;
7373
}
7474
return usingAutoFree((scope) => {
75-
const value = scope.manage(CML.Value.new(cmlUtil.maxBigNum));
75+
const value = scope.manage(CML.Value.new(cmlUtil.maxBigNum(scope)));
7676
value.set_multiasset(coreToCml.tokenMap(scope, tokenBundle));
7777

7878
return value.to_bytes().length > maxValueSize;

0 commit comments

Comments
 (0)