Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sz-piotr/ethereum-test-provider
An ethers provider used for testing applications using the ethereum blockchain
https://github.com/sz-piotr/ethereum-test-provider
ethereum ethersjs integration-testing provider snapshots testing typescript
Last synced: 22 days ago
JSON representation
An ethers provider used for testing applications using the ethereum blockchain
- Host: GitHub
- URL: https://github.com/sz-piotr/ethereum-test-provider
- Owner: sz-piotr
- License: mit
- Created: 2019-11-30T23:07:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T19:33:56.000Z (almost 3 years ago)
- Last Synced: 2024-10-16T19:18:57.380Z (about 1 month ago)
- Topics: ethereum, ethersjs, integration-testing, provider, snapshots, testing, typescript
- Language: TypeScript
- Homepage:
- Size: 347 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CircleCI](https://circleci.com/gh/sz-piotr/ethereum-test-provider.svg?style=svg)](https://circleci.com/gh/sz-piotr/ethereum-test-provider)
# Ethereum TestProvider
An ethers provider used for testing applications using the ethereum blockchain.
This project aims to provide a painless solution for writing blockchain tests.
Main features include:- Ethers.js based, no `web3` dependency
- Full TypeScript support
- Snapshots (not implemented)
- Changing time (not implemented)
- Multiple mining modes (not implemented)
- Provides wallets preloaded with ETH
- Multiple providers for the same test chain## Installation (not published yet)
With Yarn:
```
yarn add --dev ethereum-test-provider
```With npm:
```
npm install -D ethereum-test-provider
```## Example
```typescript
import { TestProvider } from 'ethereum-test-provider'const provider = new TestProvider()
const [sender] = provider.getWallets()
const recipient = provider.createEmptyWallet()await sender.sendTransaction({
to: recipient.address,
value: utils.parseEther('3.1415'),
})console.log(await recipient.getBalance()) // 3.1415
```