Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update mempool example url #105

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXT_PUBLIC_MEMPOOL_API=https://babylon.mempool.space
NEXT_PUBLIC_API_URL=https://staking-api.testnet.babylonchain.io
NEXT_PUBLIC_MEMPOOL_API=https://mempool.space
NEXT_PUBLIC_API_URL=https://staking-api.staging.babylonchain.io
jrwbabylonlab marked this conversation as resolved.
Show resolved Hide resolved
NEXT_PUBLIC_NETWORK=signet
NEXT_PUBLIC_DISPLAY_TESTING_MESSAGES=true
30 changes: 9 additions & 21 deletions tests/utils/mempool/getFundingUTXOs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ global.fetch = jest.fn() as jest.Mock;
// Mocking getNetworkConfig to return a specific mempoolApiUrl
jest.mock("@/config/network.config", () => ({
getNetworkConfig: jest.fn(() => ({
mempoolApiUrl: "https://babylon.mempool.space",
mempoolApiUrl: "https://mempool.space",
})),
}));

Expand Down Expand Up @@ -67,10 +67,7 @@ describe("getFundingUTXOs", () => {
it("should return UTXOs that satisfy the amount requirement", async () => {
(global.fetch as jest.Mock)
.mockImplementationOnce((url: URL) => {
if (
url.href ===
"https://babylon.mempool.space/api/address/testAddress/utxo"
) {
if (url.href === "https://mempool.space/api/address/testAddress/utxo") {
return Promise.resolve({
json: async () => mockUTXOs,
});
Expand All @@ -79,7 +76,7 @@ describe("getFundingUTXOs", () => {
.mockImplementationOnce((url: URL) => {
if (
url.href ===
"https://babylon.mempool.space/api/v1/validate-address/testAddress"
"https://mempool.space/api/v1/validate-address/testAddress"
) {
return Promise.resolve({
json: async () => mockAddressInfo,
Expand All @@ -102,10 +99,7 @@ describe("getFundingUTXOs", () => {
it("should return all confirmed UTXOs if no amount is provided", async () => {
(global.fetch as jest.Mock)
.mockImplementationOnce((url: URL) => {
if (
url.href ===
"https://babylon.mempool.space/api/address/testAddress/utxo"
) {
if (url.href === "https://mempool.space/api/address/testAddress/utxo") {
return Promise.resolve({
json: async () => mockUTXOs,
});
Expand All @@ -114,7 +108,7 @@ describe("getFundingUTXOs", () => {
.mockImplementationOnce((url: URL) => {
if (
url.href ===
"https://babylon.mempool.space/api/v1/validate-address/testAddress"
"https://mempool.space/api/v1/validate-address/testAddress"
) {
return Promise.resolve({
json: async () => mockAddressInfo,
Expand Down Expand Up @@ -143,10 +137,7 @@ describe("getFundingUTXOs", () => {
it("should throw an error if address is invalid", async () => {
(global.fetch as jest.Mock)
.mockImplementationOnce((url: URL) => {
if (
url.href ===
"https://babylon.mempool.space/api/address/testAddress/utxo"
) {
if (url.href === "https://mempool.space/api/address/testAddress/utxo") {
return Promise.resolve({
json: async () => mockUTXOs,
});
Expand All @@ -155,7 +146,7 @@ describe("getFundingUTXOs", () => {
.mockImplementationOnce((url: URL) => {
if (
url.href ===
"https://babylon.mempool.space/api/v1/validate-address/testAddress"
"https://mempool.space/api/v1/validate-address/testAddress"
) {
return Promise.resolve({
json: async () => mockInvalidAddressInfo,
Expand Down Expand Up @@ -186,10 +177,7 @@ describe("getFundingUTXOs", () => {

(global.fetch as jest.Mock)
.mockImplementationOnce((url: URL) => {
if (
url.href ===
"https://babylon.mempool.space/api/address/testAddress/utxo"
) {
if (url.href === "https://mempool.space/api/address/testAddress/utxo") {
return Promise.resolve({
json: async () => insufficientUTXOs,
});
Expand All @@ -198,7 +186,7 @@ describe("getFundingUTXOs", () => {
.mockImplementationOnce((url: URL) => {
if (
url.href ===
"https://babylon.mempool.space/api/v1/validate-address/testAddress"
"https://mempool.space/api/v1/validate-address/testAddress"
) {
return Promise.resolve({
json: async () => mockAddressInfo,
Expand Down