Skip to content

Commit eee4f5e

Browse files
committed
fix(cip2): compute selection limit constraint with actual fee instead of max u64
1 parent 16d7c26 commit eee4f5e

File tree

1 file changed

+3
-2
lines changed
  • packages/cip2/src/RoundRobinRandomImprove

1 file changed

+3
-2
lines changed

Diff for: packages/cip2/src/RoundRobinRandomImprove/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export const roundRobinRandomImprove = (csl: CardanoSerializationLib): InputSele
3737
})
3838
});
3939

40-
if (inputs.length > (await computeSelectionLimit({ inputs, change, fee: maxBigNum(csl), outputs }))) {
40+
const feeBigNum = csl.BigNum.from_str(fee.toString());
41+
if (inputs.length > (await computeSelectionLimit({ inputs, change, fee: feeBigNum, outputs }))) {
4142
throw new InputSelectionError(InputSelectionFailure.MaximumInputCountExceeded);
4243
}
4344

@@ -46,7 +47,7 @@ export const roundRobinRandomImprove = (csl: CardanoSerializationLib): InputSele
4647
change,
4748
inputs,
4849
outputs,
49-
fee: csl.BigNum.from_str(fee.toString())
50+
fee: feeBigNum
5051
},
5152
remainingUTxO
5253
};

0 commit comments

Comments
 (0)