@@ -40,7 +40,7 @@ describe('DigitalMarketplace', () => {
4040 nonce : testNonce ,
4141 } )
4242 const listingValue = interpretAsArc4 < ListingValue > ( Bytes ( ctx . ledger . getBox ( contract , Bytes ( 'listings' ) . concat ( listingKey . bytes ) ) ) )
43- expect ( listingValue . deposited . native ) . toEqual ( 10 )
43+ expect ( listingValue . deposited . asUint64 ( ) ) . toEqual ( 10 )
4444 } )
4545
4646 test ( 'deposit' , ( ) => {
@@ -101,7 +101,7 @@ describe('DigitalMarketplace', () => {
101101
102102 // Assert
103103 const updatedListing = interpretAsArc4 < ListingValue > ( Bytes ( ctx . ledger . getBox ( contract , Bytes ( 'listings' ) . concat ( listingKey . bytes ) ) ) )
104- expect ( updatedListing . unitaryPrice . native ) . toEqual ( testUnitaryPrice . native )
104+ expect ( updatedListing . unitaryPrice . asUint64 ( ) ) . toEqual ( testUnitaryPrice . asUint64 ( ) )
105105 } )
106106
107107 test ( 'buy' , ( ) => {
@@ -130,14 +130,14 @@ describe('DigitalMarketplace', () => {
130130 testNonce ,
131131 ctx . any . txn . payment ( {
132132 receiver : ctx . defaultSender ,
133- amount : contract . quantityPrice ( testBuyQuantity . native , testUnitaryPrice . native , testAsset . decimals ) ,
133+ amount : contract . quantityPrice ( testBuyQuantity . asUint64 ( ) , testUnitaryPrice . asUint64 ( ) , testAsset . decimals ) ,
134134 } ) ,
135- testBuyQuantity . native ,
135+ testBuyQuantity . asUint64 ( ) ,
136136 )
137137
138138 // Assert
139139 const updatedListing = interpretAsArc4 < ListingValue > ( Bytes ( ctx . ledger . getBox ( contract , Bytes ( 'listings' ) . concat ( listingKey . bytes ) ) ) )
140- expect ( updatedListing . deposited . native ) . toEqual ( initialDeposit . native - testBuyQuantity . native )
140+ expect ( updatedListing . deposited . asUint64 ( ) ) . toEqual ( initialDeposit . asUint64 ( ) - testBuyQuantity . asUint64 ( ) )
141141 expect ( ctx . txn . lastGroup . getItxnGroup ( 0 ) . getAssetTransferInnerTxn ( 0 ) . assetReceiver ) . toEqual ( ctx . defaultSender )
142142 } )
143143
@@ -176,7 +176,7 @@ describe('DigitalMarketplace', () => {
176176 const assetTransferTxn = ctx . txn . lastGroup . getItxnGroup ( 1 ) . getAssetTransferInnerTxn ( 0 )
177177 expect ( assetTransferTxn . xferAsset ) . toEqual ( testAsset )
178178 expect ( assetTransferTxn . assetReceiver ) . toEqual ( testOwner . native )
179- expect ( assetTransferTxn . assetAmount ) . toEqual ( initialDeposit . native )
179+ expect ( assetTransferTxn . assetAmount ) . toEqual ( initialDeposit . asUint64 ( ) )
180180 } )
181181
182182 test ( 'bid' , ( ) => {
@@ -200,9 +200,9 @@ describe('DigitalMarketplace', () => {
200200 } )
201201
202202 const bidder = ctx . any . account ( )
203- const bidQuantity = ctx . any . arc4 . uint64 ( 0 , BigInt ( initialDeposit . native ) )
204- const bidPrice = ctx . any . arc4 . uint64 ( initialPrice . native + 1 , 10000000n )
205- const bidAmount = contract . quantityPrice ( bidQuantity . native , bidPrice . native , testAsset . decimals )
203+ const bidQuantity = ctx . any . arc4 . uint64 ( 0 , BigInt ( initialDeposit . asUint64 ( ) ) )
204+ const bidPrice = ctx . any . arc4 . uint64 ( initialPrice . asUint64 ( ) + 1 , 10000000n )
205+ const bidAmount = contract . quantityPrice ( bidQuantity . asUint64 ( ) , bidPrice . asUint64 ( ) , testAsset . decimals )
206206
207207 // Act
208208 ctx . txn . createScope ( [ ctx . any . txn . applicationCall ( { appId : app , sender : bidder } ) ] ) . execute ( ( ) => {
@@ -223,8 +223,8 @@ describe('DigitalMarketplace', () => {
223223 // Assert
224224 const updatedListing = contract . listings ( listingKey ) . value
225225 expect ( updatedListing . bidder . native ) . toEqual ( bidder )
226- expect ( updatedListing . bid . native ) . toEqual ( bidQuantity . native )
227- expect ( updatedListing . bidUnitaryPrice . native ) . toEqual ( bidPrice . native )
226+ expect ( updatedListing . bid . asUint64 ( ) ) . toEqual ( bidQuantity . asUint64 ( ) )
227+ expect ( updatedListing . bidUnitaryPrice . asUint64 ( ) ) . toEqual ( bidPrice . asUint64 ( ) )
228228 } )
229229
230230 test ( 'acceptBid' , ( ) => {
@@ -234,7 +234,7 @@ describe('DigitalMarketplace', () => {
234234 // Arrange
235235 const owner = ctx . defaultSender
236236 const initialDeposit = ctx . any . arc4 . uint64 ( 1 , 10000000n )
237- const bidQuantity = ctx . any . arc4 . uint64 ( 0 , BigInt ( initialDeposit . native ) )
237+ const bidQuantity = ctx . any . arc4 . uint64 ( 0 , BigInt ( initialDeposit . asUint64 ( ) ) )
238238 const bidPrice = ctx . any . arc4 . uint64 ( 0 , 10000000n )
239239 const bidder = ctx . any . account ( )
240240
@@ -251,15 +251,15 @@ describe('DigitalMarketplace', () => {
251251 bidUnitaryPrice : bidPrice ,
252252 } )
253253
254- const minQuantity = initialDeposit . native < bidQuantity . native ? initialDeposit . native : bidQuantity . native
255- const expectedPayment = contract . quantityPrice ( minQuantity , bidPrice . native , testAsset . decimals )
254+ const minQuantity = initialDeposit . asUint64 ( ) < bidQuantity . asUint64 ( ) ? initialDeposit . asUint64 ( ) : bidQuantity . asUint64 ( )
255+ const expectedPayment = contract . quantityPrice ( minQuantity , bidPrice . asUint64 ( ) , testAsset . decimals )
256256
257257 // Act
258258 contract . acceptBid ( testAsset , testNonce )
259259
260260 // Assert
261261 const updatedListing = contract . listings ( listingKey ) . value
262- expect ( updatedListing . deposited . native ) . toEqual ( initialDeposit . native - minQuantity )
262+ expect ( updatedListing . deposited . asUint64 ( ) ) . toEqual ( initialDeposit . asUint64 ( ) - minQuantity )
263263
264264 expect ( ctx . txn . lastGroup . itxnGroups . length ) . toEqual ( 2 )
265265
0 commit comments