Feat/sandbox env (#1774)
* chore: add sandbox network json * style: lint * test: make tests environment agnostic
This commit is contained in:
parent
9a56fc9b6f
commit
033ee14009
3
apps/static/src/assets/sandbox-network.json
Normal file
3
apps/static/src/assets/sandbox-network.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"hosts": ["https://api.n01.sandbox.vega.xyz/graphql"]
|
||||||
|
}
|
1
apps/static/src/assets/sandbox-tranches.json
Normal file
1
apps/static/src/assets/sandbox-tranches.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
[]
|
7
apps/token/.env.sandbox
Normal file
7
apps/token/.env.sandbox
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# App configuration variables
|
||||||
|
NX_VEGA_URL=https://api.n01.sandbox.vega.xyz/graphql
|
||||||
|
NX_VEGA_ENV=SANDBOX
|
||||||
|
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","STAGNET1":"https://stagnet1.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
|
||||||
|
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/sandbox-network.json
|
||||||
|
NX_VEGA_EXPLORER_URL=https://sandbox.explorer.vega.xyz
|
||||||
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/docs/testnet
|
@ -36,6 +36,10 @@ export const ContractAddresses: {
|
|||||||
claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error
|
claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error
|
||||||
lockedAddress: '0x0', // TODO not deployed to this env
|
lockedAddress: '0x0', // TODO not deployed to this env
|
||||||
},
|
},
|
||||||
|
SANDBOX: {
|
||||||
|
claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error
|
||||||
|
lockedAddress: '0x0', // TODO not deployed to this env
|
||||||
|
},
|
||||||
TESTNET: {
|
TESTNET: {
|
||||||
claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error
|
claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error
|
||||||
lockedAddress: '0x0', // TODO not deployed to this env
|
lockedAddress: '0x0', // TODO not deployed to this env
|
||||||
|
@ -9,6 +9,7 @@ import { BigNumber } from '../lib/bignumber';
|
|||||||
const TRANCHES_URLS: { [N in Networks]: string } = {
|
const TRANCHES_URLS: { [N in Networks]: string } = {
|
||||||
MAINNET: 'https://static.vega.xyz/assets/mainnet-tranches.json',
|
MAINNET: 'https://static.vega.xyz/assets/mainnet-tranches.json',
|
||||||
TESTNET: 'https://static.vega.xyz/assets/testnet-tranches.json',
|
TESTNET: 'https://static.vega.xyz/assets/testnet-tranches.json',
|
||||||
|
SANDBOX: 'https://static.vega.xyz/assets/sandbox-tranches.json',
|
||||||
STAGNET1: 'https://static.vega.xyz/assets/stagnet1-tranches.json',
|
STAGNET1: 'https://static.vega.xyz/assets/stagnet1-tranches.json',
|
||||||
STAGNET3: 'https://static.vega.xyz/assets/stagnet3-tranches.json',
|
STAGNET3: 'https://static.vega.xyz/assets/stagnet3-tranches.json',
|
||||||
DEVNET: 'https://static.vega.xyz/assets/devnet-tranches.json',
|
DEVNET: 'https://static.vega.xyz/assets/devnet-tranches.json',
|
||||||
|
@ -13,6 +13,7 @@ import { Networks } from '../../types';
|
|||||||
export const envNameMapping: Record<Networks, string> = {
|
export const envNameMapping: Record<Networks, string> = {
|
||||||
[Networks.CUSTOM]: t('Custom'),
|
[Networks.CUSTOM]: t('Custom'),
|
||||||
[Networks.DEVNET]: t('Devnet'),
|
[Networks.DEVNET]: t('Devnet'),
|
||||||
|
[Networks.SANDBOX]: t('Sandbox'),
|
||||||
[Networks.STAGNET1]: t('Stagnet'),
|
[Networks.STAGNET1]: t('Stagnet'),
|
||||||
[Networks.STAGNET3]: t('Stagnet3'),
|
[Networks.STAGNET3]: t('Stagnet3'),
|
||||||
[Networks.TESTNET]: t('Fairground testnet'),
|
[Networks.TESTNET]: t('Fairground testnet'),
|
||||||
@ -26,6 +27,7 @@ export const envTriggerMapping: Record<Networks, string> = {
|
|||||||
|
|
||||||
export const envDescriptionMapping: Record<Networks, string> = {
|
export const envDescriptionMapping: Record<Networks, string> = {
|
||||||
[Networks.CUSTOM]: '',
|
[Networks.CUSTOM]: '',
|
||||||
|
[Networks.SANDBOX]: t('A playground test environment'),
|
||||||
[Networks.DEVNET]: t('The latest Vega code auto-deployed'),
|
[Networks.DEVNET]: t('The latest Vega code auto-deployed'),
|
||||||
[Networks.STAGNET1]: t('A release candidate for the staging environment'),
|
[Networks.STAGNET1]: t('A release candidate for the staging environment'),
|
||||||
[Networks.STAGNET3]: t('A staging environment with trading'),
|
[Networks.STAGNET3]: t('A staging environment with trading'),
|
||||||
|
@ -159,7 +159,9 @@ describe('throws error', () => {
|
|||||||
});
|
});
|
||||||
expect(result).toThrow(
|
expect(result).toThrow(
|
||||||
`Error processing the vega app environment:
|
`Error processing the vega app environment:
|
||||||
- All keys in NX_VEGA_NETWORKS must represent a valid environment: CUSTOM | TESTNET | STAGNET1 | STAGNET3 | DEVNET | MAINNET`
|
- All keys in NX_VEGA_NETWORKS must represent a valid environment: ${Object.keys(
|
||||||
|
Networks
|
||||||
|
).join(' | ')}`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -183,7 +185,9 @@ describe('throws error', () => {
|
|||||||
});
|
});
|
||||||
expect(result).toThrow(
|
expect(result).toThrow(
|
||||||
`Error processing the vega app environment:
|
`Error processing the vega app environment:
|
||||||
- NX_VEGA_ENV is invalid, received "undefined" instead of: 'CUSTOM' | 'TESTNET' | 'STAGNET1' | 'STAGNET3' | 'DEVNET' | 'MAINNET'`
|
- NX_VEGA_ENV is invalid, received "undefined" instead of: '${Object.keys(
|
||||||
|
Networks
|
||||||
|
).join("' | '")}'`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -195,7 +199,9 @@ describe('throws error', () => {
|
|||||||
});
|
});
|
||||||
expect(result).not.toThrow(
|
expect(result).not.toThrow(
|
||||||
`Error processing the vega app environment:
|
`Error processing the vega app environment:
|
||||||
- NX_VEGA_ENV is invalid, received "SOMETHING" instead of: CUSTOM | TESTNET | STAGNET1 | STAGNET3 | DEVNET | MAINNET`
|
- NX_VEGA_ENV is invalid, received "SOMETHING" instead of: '${Object.keys(
|
||||||
|
Networks
|
||||||
|
).join("' | '")}'`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,7 @@ import { compileErrors } from './compile-errors';
|
|||||||
|
|
||||||
export enum Networks {
|
export enum Networks {
|
||||||
CUSTOM = 'CUSTOM',
|
CUSTOM = 'CUSTOM',
|
||||||
|
SANDBOX = 'SANDBOX',
|
||||||
TESTNET = 'TESTNET',
|
TESTNET = 'TESTNET',
|
||||||
STAGNET1 = 'STAGNET1',
|
STAGNET1 = 'STAGNET1',
|
||||||
STAGNET3 = 'STAGNET3',
|
STAGNET3 = 'STAGNET3',
|
||||||
|
Loading…
Reference in New Issue
Block a user