Skip to content

Commit

Permalink
feat/ setting correct info for RNS usage
Browse files Browse the repository at this point in the history
  • Loading branch information
scguaquetam committed Jan 15, 2025
1 parent 9e598a7 commit 3119977
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/app/lib/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export async function dispense(data: IData) {

logger.success('Transaction succesfuly mined!');
logger.success('Retrived this receipt');
logger.success(JSON.stringify(receipt));

const data: DispenseResponse = {
txHash,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/validations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const EROR_CODE = {
'timeout-or-duplicate': 'The response is no longer valid: either is too old or has been used previously.'
}

const TESTNET_CHAIN_ID = 31;
const CHAIN_ID = 30; //We are solving RNS from mainnet, so we need to use mainnet chain id to validate addresses

export const insuficientFunds = (faucetBalance: number) =>
faucetBalance < 100000000000000000 ? 'Faucet has not enough funds.' : '';
Expand Down Expand Up @@ -47,4 +47,4 @@ export const alreadyDispensed = (address: string, ip:string, faucetHistory: Fauc
saveFaucetHistory(faucetHistory)
return ''
}
export const invalidAddress = (dispenseAddress: string): string => !isValidAddress(dispenseAddress, TESTNET_CHAIN_ID) ? 'Invalid address, provide a valid one.' : '';
export const invalidAddress = (dispenseAddress: string): string => !isValidAddress(dispenseAddress, CHAIN_ID) ? 'Invalid address, provide a valid one.' : '';

0 comments on commit 3119977

Please sign in to comment.