Fix wallet loading in review-kredits script

Requiring the wallet JSON file parses it, so we have to read it directly
from the filesystem instead.
This commit is contained in:
galfert 2021-03-30 13:51:34 +02:00
parent 09637121be
commit 2e840bcb2b
Signed by: galfert
GPG Key ID: EED8863A3A607B8D

View File

@ -1,6 +1,6 @@
#!/usr/bin/env node
require('dotenv').config({ path: '../.env' });
require('dotenv').config({ path: '.env' });
const GiteaReviews = require('./lib/gitea-reviews');
const GithubReviews = require('./lib/github-reviews');
@ -9,11 +9,12 @@ const NonceManager = require('@ethersproject/experimental').NonceManager;
const Kredits = require('kredits-contracts');
const util = require('util');
const yargs = require('yargs/yargs')
const { hideBin } = require('yargs/helpers')
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const fs = require('fs');
const walletPath = process.env.KREDITS_WALLET_PATH || '../wallet.json';
const walletJson = require(walletPath);
const walletJson = fs.readFileSync(walletPath);
const providerUrl = process.env.KREDITS_PROVIDER_URL;
const daoAddress = process.env.KREDITS_DAO_ADDRESS;