Skip to content

Commit d00bf11

Browse files
committed
use paddedVMNumber for registration id
1 parent aef3e97 commit d00bf11

File tree

12 files changed

+20
-33
lines changed

12 files changed

+20
-33
lines changed

lib/compiled/Accumulator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,5 @@ export default {
130130
'name': 'cashc',
131131
'version': '0.11.4',
132132
},
133-
'updatedAt': '2025-08-28T16:08:02.903Z',
133+
'updatedAt': '2025-08-28T16:16:07.381Z',
134134
};

lib/compiled/Auction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,5 @@ export default {
145145
'name': 'cashc',
146146
'version': '0.11.4',
147147
},
148-
'updatedAt': '2025-08-28T16:08:01.608Z',
148+
'updatedAt': '2025-08-28T16:16:06.080Z',
149149
};

lib/compiled/Bid.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,5 @@ export default {
120120
'name': 'cashc',
121121
'version': '0.11.4',
122122
},
123-
'updatedAt': '2025-08-28T16:08:01.987Z',
123+
'updatedAt': '2025-08-28T16:16:06.461Z',
124124
};

lib/compiled/ConflictResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ export default {
9595
'name': 'cashc',
9696
'version': '0.11.4',
9797
},
98-
'updatedAt': '2025-08-28T16:08:02.724Z',
98+
'updatedAt': '2025-08-28T16:16:07.201Z',
9999
};

lib/compiled/Factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,5 @@ export default {
209209
'name': 'cashc',
210210
'version': '0.11.4',
211211
},
212-
'updatedAt': '2025-08-28T16:08:02.184Z',
212+
'updatedAt': '2025-08-28T16:16:06.656Z',
213213
};

lib/compiled/Name.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,5 +345,5 @@ export default {
345345
'name': 'cashc',
346346
'version': '0.11.4',
347347
},
348-
'updatedAt': '2025-08-28T16:08:01.806Z',
348+
'updatedAt': '2025-08-28T16:16:06.279Z',
349349
};

lib/compiled/NameEnforcer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ export default {
9595
'name': 'cashc',
9696
'version': '0.11.4',
9797
},
98-
'updatedAt': '2025-08-28T16:08:02.363Z',
98+
'updatedAt': '2025-08-28T16:16:06.838Z',
9999
};

lib/compiled/OwnershipGuard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ export default {
105105
'name': 'cashc',
106106
'version': '0.11.4',
107107
},
108-
'updatedAt': '2025-08-28T16:08:02.543Z',
108+
'updatedAt': '2025-08-28T16:16:07.018Z',
109109
};

lib/compiled/Registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ export default {
6565
'name': 'cashc',
6666
'version': '0.11.4',
6767
},
68-
'updatedAt': '2025-08-28T16:08:01.425Z',
68+
'updatedAt': '2025-08-28T16:16:05.891Z',
6969
};

test/contracts/auction.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { MockNetworkProvider, randomUtxo, TransactionBuilder, Contract, type Utx
22
import { binToHex, cashAddressToLockingBytecode, hexToBin } from '@bitauth/libauth';
33
import { BitCANNArtifacts } from '../../lib/index.js';
44
import { 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';
66
import artifacts from '../artifacts.js';
77

88
describe('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

Comments
 (0)