@@ -2,7 +2,7 @@ import { MockNetworkProvider, randomUtxo, TransactionBuilder, Contract, type Utx
22import { binToHex , cashAddressToLockingBytecode , hexToBin } from '@bitauth/libauth' ;
33import { BitCANNArtifacts } from '../../lib/index.js' ;
44import { aliceAddress , alicePkh , aliceTemplate , nameTokenCategory , mockOptions , reversedNameTokenCategory , invalidNameTokenCategory , aliceTokenAddress } from '../common.js' ;
5- import { getTxOutputs , getAuctionPrice , getRegistrationIdCommitment } from '../utils.js' ;
5+ import { getTxOutputs , getAuctionPrice , padVmNumber } from '../utils.js' ;
66import artifacts from '../artifacts.js' ;
77
88describe ( 'Auction' , ( ) =>
@@ -94,7 +94,7 @@ describe('Auction', () =>
9494
9595 currentRegistrationId = parseInt ( registrationCounterUTXO . token ! . nft ! . commitment , 16 ) ;
9696 nextRegistrationId = currentRegistrationId + 1 ;
97- nextRegistrationIdCommitment = getRegistrationIdCommitment ( BigInt ( nextRegistrationId ) ) ;
97+ nextRegistrationIdCommitment = padVmNumber ( BigInt ( nextRegistrationId ) , 8 ) ;
9898
9999 auctionAmount = getAuctionPrice ( BigInt ( currentRegistrationId ) , BigInt ( mockOptions . minStartingBid ) ) ;
100100 } ) ;
@@ -506,7 +506,7 @@ describe('Auction', () =>
506506
507507 it ( 'should fail due to incorrect new registration id' , async ( ) =>
508508 {
509- const customRegistrationIdCommitment = getRegistrationIdCommitment ( BigInt ( currentRegistrationId ) + 2n ) ;
509+ const customRegistrationIdCommitment = padVmNumber ( BigInt ( currentRegistrationId ) + 2n , 8 ) ;
510510
511511 // Construct the transaction using the TransactionBuilder
512512 transaction = new TransactionBuilder ( { provider } )
@@ -792,9 +792,9 @@ describe('Auction', () =>
792792 it ( 'should pass for registrationID 120001' , async ( ) =>
793793 {
794794 const customRegistrationId = 120000n ;
795- const customRegistrationIdCommitment = getRegistrationIdCommitment ( customRegistrationId ) ;
795+ const customRegistrationIdCommitment = padVmNumber ( BigInt ( customRegistrationId ) , 8 ) ;
796796
797- const customPlusOneRegistrationIdCommitment = getRegistrationIdCommitment ( customRegistrationId + 1n ) ;
797+ const customPlusOneRegistrationIdCommitment = padVmNumber ( BigInt ( customRegistrationId ) + 1n , 8 ) ;
798798
799799 const tempRegistrationCounterUTXO : Utxo = {
800800 token : {
@@ -878,9 +878,9 @@ describe('Auction', () =>
878878 it ( 'should pass for registrationID 1000001' , async ( ) =>
879879 {
880880 const customRegistrationId = 1000000n ;
881- const customRegistrationIdCommitment = getRegistrationIdCommitment ( customRegistrationId ) ;
881+ const customRegistrationIdCommitment = padVmNumber ( BigInt ( customRegistrationId ) , 8 ) ;
882882
883- const customPlusOneRegistrationIdCommitment = getRegistrationIdCommitment ( customRegistrationId + 1n ) ;
883+ const customPlusOneRegistrationIdCommitment = padVmNumber ( BigInt ( customRegistrationId ) + 1n , 8 ) ;
884884
885885 const tempRegistrationCounterUTXO : Utxo = {
886886 token : {
@@ -964,9 +964,9 @@ describe('Auction', () =>
964964 it ( 'should fail for overflow registrationID 9223372036854775807n' , async ( ) =>
965965 {
966966 const customRegistrationId = 9223372036854775807n ;
967- const customRegistrationIdCommitment = getRegistrationIdCommitment ( customRegistrationId ) ;
967+ const customRegistrationIdCommitment = padVmNumber ( BigInt ( customRegistrationId ) , 8 ) ;
968968
969- const customPlusOneRegistrationIdCommitment = getRegistrationIdCommitment ( customRegistrationId + 1n ) ;
969+ const customPlusOneRegistrationIdCommitment = padVmNumber ( BigInt ( customRegistrationId ) + 1n , 8 ) ;
970970
971971 const tempRegistrationCounterUTXO : Utxo = {
972972 token : {
0 commit comments