Skip to content

Commit

Permalink
Test commit
Browse files Browse the repository at this point in the history
Signed-off-by: jagpreetsinghsasan <[email protected]>
  • Loading branch information
jagpreetsinghsasan committed Nov 28, 2024
1 parent 6570d4a commit 47c4447
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import Docker, { Container, ContainerInfo } from "dockerode";
import Joi from "joi";
import tar from "tar-stream";
import { EventEmitter } from "events";
import Web3 from "web3";
import { Account, TransactionReceipt } from "web3-core";
import { TransactionReceipt, Web3 } from "web3";
import Web3Account from "web3-eth-accounts";

import {
LogLevelDesc,
Logger,
Expand Down Expand Up @@ -162,10 +163,12 @@ export class BesuTestLedger implements ITestLedger {
*
* @param [seedMoney=10e8] The amount of money to seed the new test account with.
*/
public async createEthTestAccount(seedMoney = 10e8): Promise<Account> {
public async createEthTestAccount(
seedMoney = 10e8,
): Promise<Web3Account.Web3Account> {
const rpcApiHttpHost = await this.getRpcApiHttpHost();
const web3 = new Web3(rpcApiHttpHost);
const ethTestAccount = web3.eth.accounts.create(uuidv4());
const ethTestAccount = web3.eth.accounts.create();

await this.sendEthToAccount(ethTestAccount.address, seedMoney);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
Logger,
} from "@hyperledger/cactus-common";
import { IDockerPullProgress } from "./i-docker-pull-progress";
import { Stream } from "stream";

export interface IPruneDockerResourcesRequest {
logLevel?: LogLevelDesc;
Expand Down Expand Up @@ -445,7 +446,7 @@ export class Containers {

const pullStreamStartedHandler = (
pullError: unknown,
stream: NodeJS.ReadableStream,
stream: Stream,
) => {
if (pullError) {
log.error(`Could not even start ${imageFqn} pull:`, pullError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import isPortReachable from "is-port-reachable";
import Joi from "joi";
import { EventEmitter } from "events";
import { ITestLedger } from "../i-test-ledger";
import { Stream } from "stream";

const OPTS_SCHEMA: Joi.Schema = Joi.object().keys({
imageVersion: Joi.string().min(5).required(),
Expand Down Expand Up @@ -212,7 +213,7 @@ export class HttpEchoContainer implements ITestLedger {
const docker = new Docker();
docker.pull(
containerNameAndTag,
(pullError: unknown, stream: NodeJS.ReadableStream) => {
(pullError: unknown, stream: Stream) => {
if (pullError) {
reject(pullError);
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { EventEmitter } from "events";
import Docker, { Container } from "dockerode";
import { v4 as internalIpV4 } from "internal-ip";
import Web3 from "web3";
import { TransactionReceipt, Web3 } from "web3";
import Web3Account from "web3-eth-accounts";
import { AbiItem } from "web3-utils";
import { Account, TransactionReceipt } from "web3-core";
import { v4 as uuidv4 } from "uuid";

import {
Expand Down Expand Up @@ -207,8 +207,8 @@ export class OpenEthereumTestLedger {
*
* @param [seedMoney=10e8] The amount of money to seed the new test account with.
*/
public async createEthTestAccount(seedMoney = 10e8): Promise<Account> {
const ethTestAccount = this.web3.eth.accounts.create(uuidv4());
public async createEthTestAccount(seedMoney = 10e8): Promise<Web3Account.Web3Account> {
const ethTestAccount = this.web3.eth.accounts.create();

const receipt = await this.transferAssetFromCoinbase(
ethTestAccount.address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { ITestLedger } from "../i-test-ledger";
import { Streams } from "../common/streams";
import { Containers } from "../common/containers";
import { Stream } from "stream";

/*
* Contains options for Postgres container
Expand Down Expand Up @@ -288,7 +289,7 @@ export class PostgresTestContainer implements ITestLedger {
const docker = new Docker();
docker.pull(
containerNameAndTag,
(pullError: unknown, stream: NodeJS.ReadableStream) => {
(pullError: unknown, stream: Stream) => {
if (pullError) {
reject(pullError);
} else {
Expand Down

0 comments on commit 47c4447

Please sign in to comment.