Skip to content

Commit

Permalink
Update code post review
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibautBremand committed Aug 20, 2023
1 parent eefb4f7 commit c47d0b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const submitTransactionsBulk = async (
};

if (payload.transactions.length === 0 || payload.transactions.length > MAX_TRANSACTIONS) {
throw new Error('Invalid number of transactions');
throw new Error(`Invalid number of transactions (must be between 1 and ${MAX_TRANSACTIONS})`);
}

try {
Expand Down
9 changes: 3 additions & 6 deletions packages/constants/src/network/network.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ export enum NetworkServer {
MAINNET = 'wss://xrplcluster.com',
TESTNET = 'wss://s.altnet.rippletest.net:51233',
DEVNET = 'wss://s.devnet.rippletest.net:51233',
AMM_DEVNET = 'wss://amm.devnet.rippletest.net:51233'
}

export enum MainnetClioServer {
S1 = 'wss://s1.ripple.com',
S2 = 'wss://s2.ripple.com'
AMM_DEVNET = 'wss://amm.devnet.rippletest.net:51233',
MAINNET_S1 = 'wss://s1.ripple.com', // Clio
MAINNET_S2 = 'wss://s2.ripple.com' // Clio
}

export const NETWORK = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import {
CreateNFTOfferRequest,
CreateOfferRequest,
GetNFTRequest,
MainnetClioServer,
MintNFTRequest,
Network,
NetworkServer,
NFTData,
NFTokenIDResponse,
SendPaymentRequest,
Expand Down Expand Up @@ -892,9 +892,9 @@ const LedgerProvider: FC = ({ children }) => {
// Connect to Clio server for mainnet
let clioClient;
try {
clioClient = await connectToLedger(MainnetClioServer.S1);
clioClient = await connectToLedger(NetworkServer.MAINNET_S1);
} catch {
clioClient = await connectToLedger(MainnetClioServer.S2).catch(() => {
clioClient = await connectToLedger(NetworkServer.MAINNET_S2).catch(() => {
throw new Error("Couldn't connect to a Clio server");
});
}
Expand Down

0 comments on commit c47d0b3

Please sign in to comment.