@@ -2,7 +2,7 @@ import type { bytes, op, uint64 } from '@algorandfoundation/algorand-typescript'
2
2
import { MAX_BOX_SIZE } from '../constants'
3
3
import { lazyContext } from '../context-helpers/internal-context'
4
4
import { AvmError , InternalError } from '../errors'
5
- import { asBytes , asBytesCls , asNumber , asUint8Array , conactUint8Arrays } from '../util'
5
+ import { asBytes , asBytesCls , asNumber , asUint8Array , concatUint8Arrays } from '../util'
6
6
import { toBytes } from './encoded-types'
7
7
import type { StubBytesCompat , StubUint64Compat } from './primitives'
8
8
@@ -79,7 +79,7 @@ export const Box: typeof op.Box = {
79
79
if ( start + newContent . length > boxContent . length ) {
80
80
throw new InternalError ( 'Replacement content exceeds box size' )
81
81
}
82
- const updatedContent = conactUint8Arrays ( boxContent . slice ( 0 , start ) , newContent , boxContent . slice ( start + newContent . length ) )
82
+ const updatedContent = concatUint8Arrays ( boxContent . slice ( 0 , start ) , newContent , boxContent . slice ( start + newContent . length ) )
83
83
lazyContext . ledger . setBox ( app , name , updatedContent )
84
84
} ,
85
85
resize ( a : StubBytesCompat , b : StubUint64Compat ) : void {
@@ -93,7 +93,7 @@ export const Box: typeof op.Box = {
93
93
const size = boxContent . length
94
94
let updatedContent
95
95
if ( newSize > size ) {
96
- updatedContent = conactUint8Arrays ( boxContent , new Uint8Array ( newSize - size ) )
96
+ updatedContent = concatUint8Arrays ( boxContent , new Uint8Array ( newSize - size ) )
97
97
} else {
98
98
updatedContent = boxContent . slice ( 0 , newSize )
99
99
}
@@ -114,12 +114,12 @@ export const Box: typeof op.Box = {
114
114
throw new InternalError ( 'Start index exceeds box size' )
115
115
}
116
116
const end = Math . min ( start + length , size )
117
- let updatedContent = conactUint8Arrays ( boxContent . slice ( 0 , start ) , newContent , boxContent . slice ( end ) )
117
+ let updatedContent = concatUint8Arrays ( boxContent . slice ( 0 , start ) , newContent , boxContent . slice ( end ) )
118
118
// Adjust the size if necessary
119
119
if ( updatedContent . length > size ) {
120
120
updatedContent = updatedContent . slice ( 0 , size )
121
121
} else if ( updatedContent . length < size ) {
122
- updatedContent = conactUint8Arrays ( updatedContent , new Uint8Array ( size - asNumber ( updatedContent . length ) ) )
122
+ updatedContent = concatUint8Arrays ( updatedContent , new Uint8Array ( size - asNumber ( updatedContent . length ) ) )
123
123
}
124
124
lazyContext . ledger . setBox ( app , name , updatedContent )
125
125
} ,
0 commit comments