If It has 3 transactions, call get_transactions fail with Natural subtraction underflow.
you can test it if set a length less than start (by search inside transactions).
// dfx call
call get_transactions '(record{start=2 : nat; length=1 : nat})'
the bug cause by this line.
|
txs_in_canister:= SB.slice(transactions, tx_start_index, req.length); |
function SB.sclice accept argument (buffer, start, end)
|
StableBuffer with slice = func<A>(buffer : T.StableBuffer<A>, start : Nat, end : Nat) : [A] { |
but the code call it , SB.slice(transactions, tx_start_index, req.length).
it should fix to
SB.slice(transactions, tx_start_index, tx_start_index + req.length).
could you fix this? or may I pull a request.
If It has 3 transactions, call get_transactions fail with Natural subtraction underflow.
you can test it if set a length less than start (by search inside transactions).
the bug cause by this line.
icrc1/src/ICRC1/lib.mo
Line 352 in 2ede9a6
function SB.sclice accept argument (buffer, start, end)
icrc1/src/ICRC1/Utils.mo
Line 261 in 2ede9a6
but the code call it , SB.slice(transactions, tx_start_index, req.length).
it should fix to
could you fix this? or may I pull a request.