Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
test(contract): add deploy and call contract function celo test
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst committed Jun 17, 2020
1 parent d1d96ce commit 8a06893
Show file tree
Hide file tree
Showing 9 changed files with 286 additions and 138 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
export PATH=$HOME/bin:$PATH
cargo test
- name: cargo test (Celo)
run: |
export PATH=$HOME/bin:$PATH
cargo test --all-features
- name: cargo fmt
run: cargo fmt --all -- --check

Expand Down
71 changes: 71 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <h1 align="center"> ethers.rs </h1>

**Complete Ethereum wallet implementation and utilities in Rust**
**Complete Ethereum and Celo wallet implementation and utilities in Rust**

[![CircleCI](https://circleci.com/gh/circleci/circleci-docs.svg?style=svg)](https://circleci.com/gh/circleci/circleci-docs)

Expand All @@ -20,6 +20,24 @@ ethers = { git = "github.com/gakonst/ethers-rs" }

</details>

### Celo Support

[Celo](http://celo.org/) support is turned on via the feature-flag `celo`:

```toml
[dependencies]

ethers = { git = "github.com/gakonst/ethers-rs", features = ["celo"] }
```

Celo's transactions differ from Ethereum transactions by including 3 new fields:
- `fee_currency`: The currency fees are paid in (None for CELO, otherwise it's an Address)
- `gateway_fee_recipient`: The address of the fee recipient (None for no gateway fee paid)
- `gateway_fee`: Gateway fee amount (None for no gateway fee paid)

The feature flag enables these additional fields in the transaction request builders and
in the transactions which are fetched over JSON-RPC.

## Features

- [x] Ethereum JSON-RPC Client
Expand All @@ -28,6 +46,7 @@ ethers = { git = "github.com/gakonst/ethers-rs" }
- [x] Querying past events
- [x] Event monitoring as `Stream`s
- [x] ENS as a first class citizen
- [x] Celo support
- [ ] Websockets / `eth_subscribe`
- [ ] Hardware Wallet Support
- [ ] WASM Bindings
Expand Down
3 changes: 2 additions & 1 deletion ethers-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ futures = "0.3.5"
ethers = { version = "0.1.0", path = "../ethers" }
tokio = { version = "0.2.21", default-features = false, features = ["macros"] }
serde_json = "1.0.55"
serial_test = "0.4.0"

[features]
abigen = ["ethers-contract-abigen", "ethers-contract-derive"]
celo = ["ethers-core/celo", "ethers-providers/celo", "ethers-signers/celo", "ethers/celo"]
celo = ["ethers-core/celo", "ethers-core/celo", "ethers-providers/celo", "ethers-signers/celo"]
3 changes: 2 additions & 1 deletion ethers-contract/src/factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ use ethers_signers::{Client, Signer};
#[derive(Debug, Clone)]
/// Helper which manages the deployment transaction of a smart contract
pub struct Deployer<'a, P, S> {
/// The deployer's transaction, exposed for overriding the defaults
pub tx: TransactionRequest,
abi: Abi,
client: &'a Client<P, S>,
tx: TransactionRequest,
confs: usize,
}

Expand Down
Loading

0 comments on commit 8a06893

Please sign in to comment.