@@ -2,7 +2,7 @@ import type { bytes, op, uint64 } from '@algorandfoundation/algorand-typescript'
22import { MAX_BOX_SIZE } from '../constants'
33import { lazyContext } from '../context-helpers/internal-context'
44import { AvmError , InternalError } from '../errors'
5- import { asBytes , asBytesCls , asNumber , asUint8Array , conactUint8Arrays } from '../util'
5+ import { asBytes , asBytesCls , asNumber , asUint8Array , concatUint8Arrays } from '../util'
66import { toBytes } from './encoded-types'
77import type { StubBytesCompat , StubUint64Compat } from './primitives'
88
@@ -79,7 +79,7 @@ export const Box: typeof op.Box = {
7979 if ( start + newContent . length > boxContent . length ) {
8080 throw new InternalError ( 'Replacement content exceeds box size' )
8181 }
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 ) )
8383 lazyContext . ledger . setBox ( app , name , updatedContent )
8484 } ,
8585 resize ( a : StubBytesCompat , b : StubUint64Compat ) : void {
@@ -93,7 +93,7 @@ export const Box: typeof op.Box = {
9393 const size = boxContent . length
9494 let updatedContent
9595 if ( newSize > size ) {
96- updatedContent = conactUint8Arrays ( boxContent , new Uint8Array ( newSize - size ) )
96+ updatedContent = concatUint8Arrays ( boxContent , new Uint8Array ( newSize - size ) )
9797 } else {
9898 updatedContent = boxContent . slice ( 0 , newSize )
9999 }
@@ -114,12 +114,12 @@ export const Box: typeof op.Box = {
114114 throw new InternalError ( 'Start index exceeds box size' )
115115 }
116116 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 ) )
118118 // Adjust the size if necessary
119119 if ( updatedContent . length > size ) {
120120 updatedContent = updatedContent . slice ( 0 , size )
121121 } 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 ) ) )
123123 }
124124 lazyContext . ledger . setBox ( app , name , updatedContent )
125125 } ,
0 commit comments