Skip to content

Commit

Permalink
Updates readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
robotoer committed Jul 30, 2024
1 parent ebb5b5b commit a09b99c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `viem-mock-contract`
# `@term-finance/viem-mock-contract`

This project adds the ability to deploy a mock contract to the blockchain using
the `hardhat-viem` plugin for `hardhat`.
Expand All @@ -10,32 +10,34 @@ To install this project, run the following commands:
`npm`:

```shell
npm install --save-dev viem-mock-contract
npm install --save-dev @term-finance/viem-mock-contract
```

`yarn`:

```shell
yarn add --dev viem-mock-contract
yarn add --dev @term-finance/viem-mock-contract
```

## Usage

To use this project, add the following to your `hardhat.config.js`:

```javascript
require("viem-mock-contract");
require("@term-finance/viem-mock-contract");
```

Then, you can write tests that deploy a mock contract to the blockchain:

```typescript
import hre from "hardhat";
import { deployMock } from "viem-mock-contract";
import { deployMock } from "@term-finance/viem-mock-contract";

describe("MyContract", () => {
it("should deploy a mock contract", async () => {
const mockContract = await deployMock();
const reader = await hre.viem.getPublicClient();
const [signer] = await hre.viem.getWalletClients();
const mockContract = await deployMock(signer, reader);

// Add expectations to mock
await deployMock.setup(
Expand Down

0 comments on commit a09b99c

Please sign in to comment.