Celo Alfajores faucet

This commit is contained in:
Victor Baranov 2021-02-11 17:06:27 +03:00
parent ec382cd9d9
commit 2c22f92d10
4 changed files with 12 additions and 2 deletions

View File

@ -6,6 +6,7 @@ const {
KOVAN_CODE,
SOKOL_CODE,
RSK_TESTNET_CODE,
CELO_ALFAJORES_TESTNET_CODE,
} = networkIDs
function getFaucetLinks(network) {
@ -23,6 +24,8 @@ function getFaucetLinks(network) {
return ['https://faucet.poa.network/']
case RSK_TESTNET_CODE:
return ['https://faucet.rsk.co/']
case CELO_ALFAJORES_TESTNET_CODE:
return ['https://celo.org/developers/faucet']
default:
return []
}

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "eth-net-props",
"version": "1.0.39",
"version": "1.0.40",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "eth-net-props",
"version": "1.0.39",
"version": "1.0.40",
"description": "Get properties of EMV-based network",
"main": "index.js",
"directories": {

View File

@ -194,6 +194,13 @@ describe('eth-net-props', () => {
assert.equal(goerliFaucetLinks[0], 'https://goerli-faucet.slock.it/')
}
})
it(`${claimPrefix} CELO Alfajores`, () => {
const celoAlfajoresFaucetLinks = faucetLinks.getFaucetLinks(44787)
assert.equal(celoAlfajoresFaucetLinks.length, 1)
if (celoAlfajoresFaucetLinks.length > 0) {
assert.equal(celoAlfajoresFaucetLinks[0], 'https://celo.org/developers/faucet')
}
})
it('should not return faucet link for production blockchains', () => {
assert.equal(faucetLinks.getFaucetLinks(1).length, 0)
assert.equal(faucetLinks.getFaucetLinks(99).length, 0)