Adapt code to BCP changes

This commit is contained in:
Simon Warta
2020-02-14 16:29:53 +01:00
parent a12ceb8916
commit da2ce9987e
5 changed files with 36 additions and 39 deletions
+3 -3
View File
@@ -23,13 +23,13 @@ export async function start(args: ReadonlyArray<string>): Promise<void> {
);
console.info(`Connecting to blockchain ${blockchainBaseUrl} ...`);
const connection = await connector.establishConnection();
console.info(`Connected to network: ${connection.chainId()}`);
console.info(`Connected to network: ${connection.chainId}`);
// Profile
if (!constants.mnemonic) throw new Error("The FAUCET_MNEMONIC environment variable is not set");
const [profile] = await createUserProfile(
constants.mnemonic,
connection.chainId(),
connection.chainId,
constants.concurrency,
true,
);
@@ -52,6 +52,6 @@ export async function start(args: ReadonlyArray<string>): Promise<void> {
setInterval(async () => faucet.refill(), 60_000); // ever 60 seconds
console.info("Creating webserver ...");
const server = new Webserver(faucet, { nodeUrl: blockchainBaseUrl, chainId: connection.chainId() });
const server = new Webserver(faucet, { nodeUrl: blockchainBaseUrl, chainId: connection.chainId });
server.start(constants.port);
}
+2 -2
View File
@@ -54,7 +54,7 @@ export class Faucet {
public async send(job: SendJob): Promise<void> {
const sendWithFee = await this.connection.withDefaultFee<SendTransaction>({
kind: "bcp/send",
chainId: this.connection.chainId(),
chainId: this.connection.chainId,
sender: this.codec.identityToAddress(job.sender),
senderPubkey: job.sender.pubkey,
recipient: job.recipient,
@@ -113,7 +113,7 @@ export class Faucet {
public async refill(): Promise<void> {
if (this.logging) {
console.info(`Connected to network: ${this.connection.chainId()}`);
console.info(`Connected to network: ${this.connection.chainId}`);
console.info(`Tokens on network: ${(await this.loadTokenTickers()).join(", ")}`);
}