Skip to content

Commit 5b2fa0f

Browse files
committed
test(sdk-coin-xlm): remove TUSDC ALPHANUM12 enabletoken tests
Remove the TUSDC-specific verifyTransaction tests added in the prior commit. The token onboarding in statics is sufficient; the SDK signing/verify path for ALPHANUM12 assets is covered by the HSM firmware changes in the parent ticket (CSHLD-1407). Ticket: CSHLD-1447 Session-Id: bb58b0aa-c314-4212-8901-e1cfc7a3c8db Task-Id: 31db5ad2-ab59-4d9f-8c21-6acc91a05c08
1 parent 3094438 commit 5b2fa0f

1 file changed

Lines changed: 0 additions & 69 deletions

File tree

  • modules/sdk-coin-xlm/test/unit

modules/sdk-coin-xlm/test/unit/xlm.ts

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,75 +1016,6 @@ describe('XLM:', function () {
10161016
});
10171017
});
10181018

1019-
describe('ALPHANUM12 token (txlm:TUSDC) enabletoken verification', function () {
1020-
// TUSDC is a 5-char asset code — encoded as assetTypeCreditAlphanum12 in Stellar XDR.
1021-
// All prior test fixtures use 3–4 char (ALPHANUM4) codes; these tests verify that the
1022-
// verifyTransaction path handles the ALPHANUM12 encoding correctly (CSHLD-1447).
1023-
const stellarNetworkPassphrase = stellar.Networks.TESTNET;
1024-
const sourceAddress = 'GA34NPQ4M54HHZBKSDZ5B3J3BZHTXKCZD4UFO2OYZERPOASK4DAATSIB';
1025-
const tusdcIssuer = 'GC26PEYGETD7L6PUW2VCU3PSC7LCLRRPOSUILSHD2RT23IQUEAN4TQBQ';
1026-
const tusdcTokenName = `txlm:TUSDC-${tusdcIssuer}`;
1027-
const tusdcAsset = new stellar.Asset('TUSDC', tusdcIssuer);
1028-
1029-
const buildTxBase64 = (ops: stellar.xdr.Operation[]): string => {
1030-
const sourceAccount = new stellar.Account(sourceAddress, '1');
1031-
const tx = new stellar.TransactionBuilder(sourceAccount, {
1032-
fee: '100',
1033-
networkPassphrase: stellarNetworkPassphrase,
1034-
});
1035-
ops.forEach((op) => tx.addOperation(op));
1036-
return tx.setTimeout(0).build().toEnvelope().toXDR('base64');
1037-
};
1038-
1039-
it('should verify a changeTrust for a 5-char ALPHANUM12 asset (TUSDC)', async function () {
1040-
const txPrebuild = {
1041-
txBase64: buildTxBase64([stellar.Operation.changeTrust({ asset: tusdcAsset })]),
1042-
};
1043-
const txParams = {
1044-
type: 'enabletoken',
1045-
recipients: [{ tokenName: tusdcTokenName, amount: 0, address: '' }],
1046-
};
1047-
const isValid = await basecoin.verifyTransaction({
1048-
txParams,
1049-
txPrebuild,
1050-
wallet: {},
1051-
verification: { verifyTokenEnablement: true },
1052-
});
1053-
isValid.should.equal(true);
1054-
});
1055-
1056-
it('should reject a changeTrust whose issuer does not match txlm:TUSDC', async function () {
1057-
const differentIssuer = 'GCWHAO4SVB4KX3Q62QZGZUHUH2GSH3OIV7IS7Y3MPQOFGQFGBP6IYCOU';
1058-
const differentAsset = new stellar.Asset('TUSDC', differentIssuer);
1059-
const txPrebuild = {
1060-
txBase64: buildTxBase64([stellar.Operation.changeTrust({ asset: differentAsset })]),
1061-
};
1062-
const txParams = {
1063-
type: 'enabletoken',
1064-
recipients: [{ tokenName: tusdcTokenName, amount: 0, address: '' }],
1065-
};
1066-
await basecoin
1067-
.verifyTransaction({ txParams, txPrebuild, wallet: {}, verification: { verifyTokenEnablement: true } })
1068-
.should.be.rejectedWith(
1069-
`Invalid issuer on token enablement operation: expected ${tusdcIssuer}, got ${differentIssuer}`
1070-
);
1071-
});
1072-
1073-
it('should reject a changeTrust whose asset code does not match TUSDC', async function () {
1074-
const wrongAsset = new stellar.Asset('USDCX', tusdcIssuer);
1075-
const txPrebuild = {
1076-
txBase64: buildTxBase64([stellar.Operation.changeTrust({ asset: wrongAsset })]),
1077-
};
1078-
const txParams = {
1079-
type: 'enabletoken',
1080-
recipients: [{ tokenName: tusdcTokenName, amount: 0, address: '' }],
1081-
};
1082-
await basecoin
1083-
.verifyTransaction({ txParams, txPrebuild, wallet: {}, verification: { verifyTokenEnablement: true } })
1084-
.should.be.rejectedWith('Invalid token code on token enablement operation: expected TUSDC, got USDCX');
1085-
});
1086-
});
1087-
10881019
describe('Federation lookups:', function () {
10891020
describe('Look up by stellar address:', function () {
10901021
it('should fail to loop up an invalid stellar address with a bitgo.com domain', async function () {

0 commit comments

Comments
 (0)