Skip to content

Commit 66e102b

Browse files
CassioMGclaude
andcommitted
test(assets): describe the pinned native addresses and derived-address cases plainly
The comment above the pinned native SAC addresses referred to an internal task-plan step and to hardcoding that no longer exists at this commit. Say why the values are pinned instead. Rename the derived-address cases to state what they check rather than what preceded them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent b81e332 commit 66e102b

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

@shared/helpers/__tests__/assetIdentity.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import {
2121
const XLM_CODED_ISSUER =
2222
"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN";
2323

24-
// The published native SAC addresses. Pinned rather than re-derived, so these
25-
// tests also assert that deriving from the passphrase reproduces the values
26-
// getNativeContractDetails hardcodes before Task 8 removes them.
24+
// The published native SAC addresses, pinned rather than re-derived, so these
25+
// tests assert that deriving from the passphrase reproduces the known-good
26+
// values rather than just agreeing with themselves.
2727
const NATIVE_SAC_PUBLIC =
2828
"CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA";
2929
const NATIVE_SAC_TESTNET =
@@ -130,7 +130,7 @@ describe("getNativeContractId", () => {
130130
expect(getNativeContractId(Networks.TESTNET)).toBe(NATIVE_SAC_TESTNET);
131131
});
132132

133-
it("returns a real address on a network the old lookup table omitted", () => {
133+
it("derives a distinct address on FUTURENET", () => {
134134
const futurenet = getNativeContractId(Networks.FUTURENET);
135135
expect(futurenet).toMatch(/^C[A-Z2-7]{55}$/);
136136
expect(futurenet).not.toBe(NATIVE_SAC_PUBLIC);

extension/src/popup/helpers/__tests__/searchAsset.test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ describe("searchAsset", () => {
8181
org: "",
8282
});
8383
});
84-
it("should derive getNativeContractDetails for a network the table doesn't cover", () => {
85-
// The contract address is now derived from the passphrase rather than
86-
// read from a table, so a network outside PUBLIC/TESTNET gets a real
87-
// address instead of the empty string the table used to fall back to.
84+
it("derives the native contract address on FUTURENET", () => {
85+
// The contract address is derived from the network passphrase, so every
86+
// network gets a real address.
8887
expect(
8988
SearchAsset.getNativeContractDetails({
9089
network: "FUTURENET",

extension/src/popup/helpers/__tests__/searchAsset.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe("getNativeContractDetails", () => {
5757
).toBe("CAS3J7GYLGXMF6TDJBBYYSE3HQ6BBSMLNUQ34T6TZMYMW2EVH34XOWMA");
5858
});
5959

60-
it("returns a contract address on a network the table omitted", () => {
60+
it("returns a derived contract address on FUTURENET", () => {
6161
expect(
6262
getNativeContractDetails({
6363
network: "FUTURENET",

extension/src/popup/helpers/__tests__/soroban.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const futurenetDetails = {
99
} as NetworkDetails;
1010

1111
describe("isAssetSac", () => {
12-
it("recognises the native contract on a network the old table omitted", () => {
12+
it("recognises the native contract on FUTURENET", () => {
1313
expect(
1414
isAssetSac({
1515
asset: {

0 commit comments

Comments
 (0)