• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GoodDollar / GoodServer / 16730210565

15 May 2025 06:46AM UTC coverage: 49.341% (-0.3%) from 49.666%
16730210565

push

github

sirpy
fix: remove defualt gas fees

597 of 1485 branches covered (40.2%)

Branch coverage included in aggregate %.

1875 of 3525 relevant lines covered (53.19%)

7.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

35.14
/src/server/blockchain/BaseAdminWallet.js
1
import { default as SuperfluidFaucetABI } from '@gooddollar/goodprotocol/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.json'
2
import ContractsAddress from '@gooddollar/goodprotocol/releases/deployment.json'
3
import { get } from 'lodash'
4
import { Web3Wallet } from './Web3Wallet'
5
import conf from '../server.config'
6

7
const { base, env } = conf
6✔
8
const options = {
6✔
9
  ethereum: base,
10
  network: `${env}-base`,
11
  maxFeePerGas: undefined, // will force use of estimatefees
12
  maxPriorityFeePerGas: undefined, // will force use of estimate fees
13
  fetchGasPrice: false,
14
  faucetTxCost: 500000
15
}
16

17
export class BaseAdminWallet extends Web3Wallet {
18
  constructor(opts = {}, celoWallet) {
×
19
    super('BaseAdminWallet', conf, { ...options, ...opts })
1✔
20
    this.celoWallet = celoWallet
1✔
21
  }
22

23
  async initialize() {
24
    const ready = super.initialize()
2✔
25
    return ready.then(r => {
2✔
26
      if (r) {
2!
27
        this.faucetContract = new this.web3.eth.Contract(
2✔
28
          SuperfluidFaucetABI.abi,
29
          get(ContractsAddress, `${this.network}.SuperfluidFaucet`),
30
          {
31
            from: this.address
32
          }
33
        )
34
      }
35
      return r
2✔
36
    })
37
  }
38

39
  async topWallet(address, customLogger = null) {
×
40
    const logger = customLogger || this.log
×
41
    if (!this.faucetContract) return true
×
42
    if (await this.celoWallet.isVerified(address)) {
×
43
      const { baseFeePerGas = 1e7 } = await this.web3.eth.getBlock('latest')
×
44
      const canTop = await this.faucetContract.methods
×
45
        .canTop(address, baseFeePerGas)
46
        .call()
47
        .catch(() => true)
×
48
      if (canTop) {
×
49
        return this.topWalletFaucet(address, logger).catch(() => false)
×
50
      }
51
      return false
×
52
    }
53
    logger.info('BaseAdminWallet topWalletFailed: address not whitelisted on celo', { address })
×
54
    return false
×
55
  }
56

57
  async whitelistUser() {
58
    return true
1✔
59
  }
60

61
  async isVerified() {
62
    return false
1✔
63
  }
64
  async removeWhitelisted() {
65
    return true
1✔
66
  }
67
  async registerRedtent() {
68
    return true
×
69
  }
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc