Skip to content

Commit

Permalink
Comment out usage of hardhat ethers in ethereum service
Browse files Browse the repository at this point in the history
  • Loading branch information
ognjenkurtic committed Oct 23, 2023
1 parent 153b8aa commit 45bb58c
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import { ethers } from 'hardhat';
import { readFile, writeFile } from 'fs/promises';
import { Injectable } from '@nestjs/common';
import { Injectable, NotImplementedException } from '@nestjs/common';
import { IBlockchainService } from '../blockchain.interface';
import { Contract } from 'ethers';

@Injectable()
export class EthereumService implements IBlockchainService {
public async deployContract(contractName: string): Promise<void> {
const ccsmContract = await ethers.getContractFactory(contractName);
const deployedCcsmContract = await ccsmContract.deploy();
await this.storeDeployedContractAddress(deployedCcsmContract.address);
throw new NotImplementedException();
// TODO: We need to use ethers js here for connection, not hardhat ethers
// const ccsmContract = await ethers.getContractFactory(contractName);
// const deployedCcsmContract = await ccsmContract.deploy();
// await this.storeDeployedContractAddress(deployedCcsmContract.address);
}

async connectToContract(contractName: string): Promise<Contract> {
const ccsmContractAddress = await this.getDeployedContractAddress();
return await ethers.getContractAt(contractName, ccsmContractAddress);
throw new NotImplementedException();
// TODO: We need to use ethers js here for connection, not hardhat ethers
// const ccsmContractAddress = await this.getDeployedContractAddress();
// return await ethers.getContractAt(contractName, ccsmContractAddress);
}

public async storeAnchorHash(
Expand Down

0 comments on commit 45bb58c

Please sign in to comment.