Skip to content

fix: normalize BGL bridge submit endpoint#2

Open
tolga-tom-nook wants to merge 1 commit into
BitgesellOfficial:mainfrom
tolga-tom-nook:fix/bgl-bridge-endpoint-slash
Open

fix: normalize BGL bridge submit endpoint#2
tolga-tom-nook wants to merge 1 commit into
BitgesellOfficial:mainfrom
tolga-tom-nook:fix/bgl-bridge-endpoint-slash

Conversation

@tolga-tom-nook
Copy link
Copy Markdown

Summary

Normalizes the BGL bridge submit endpoint before appending /submit/bgl.

The default bridge endpoint includes a trailing slash:

this.bridgeEndpoint = config.bridgeEndpoint || 'https://bglswap.com/app/'

But _submitToBridge appended another slash:

`${this.bridgeEndpoint}/submit/bgl`

That produces https://bglswap.com/app//submit/bgl for the default/configured endpoint. This PR trims trailing slashes first so both https://bglswap.com/app/ and https://bglswap.com/app resolve to the canonical https://bglswap.com/app/submit/bgl URL.

Validation

Focused regression test:

npx jest src/__tests__/BGLBridgeEndpoint.test.ts --runInBand --coverage=false

Result:

PASS src/__tests__/BGLBridgeEndpoint.test.ts
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total

Targeted lint:

npx eslint src/bridge/BGL.ts src/__tests__/BGLBridgeEndpoint.test.ts --ext .ts

Result: passed.

Diff hygiene:

git diff --check

Result: clean.

Note: npm run build is currently blocked by the repo's dependency/toolchain mismatch after fresh install (@types/node requires disposable lib symbols not available to the pinned TypeScript 4.9 toolchain). The focused Jest regression and targeted ESLint pass for this change.

Bounty context: Bitgesell PR bounty/improvement program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant