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

Commit ba5ae5a

Browse files
authored
Add Celo support (#8)
* feat(types): add optional Celo support * feat: add Celo feature flags to all crates * test(provider): add get_transaction celo test * test(signer): add send_transaction celo test * test(contract): add deploy and call contract function celo test
1 parent 20493e0 commit ba5ae5a

File tree

17 files changed

+529
-215
lines changed

17 files changed

+529
-215
lines changed

Diff for: .github/workflows/ci.yml

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ jobs:
4242
export PATH=$HOME/bin:$PATH
4343
cargo test
4444
45+
- name: cargo test (Celo)
46+
run: |
47+
export PATH=$HOME/bin:$PATH
48+
cargo test --all-features
49+
4550
- name: cargo fmt
4651
run: cargo fmt --all -- --check
4752

Diff for: Cargo.lock

+72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <h1 align="center"> ethers.rs </h1>
22

3-
**Complete Ethereum wallet implementation and utilities in Rust**
3+
**Complete Ethereum and Celo wallet implementation and utilities in Rust**
44

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

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

2121
</details>
2222

23+
### Celo Support
24+
25+
[Celo](http://celo.org/) support is turned on via the feature-flag `celo`:
26+
27+
```toml
28+
[dependencies]
29+
30+
ethers = { git = "github.com/gakonst/ethers-rs", features = ["celo"] }
31+
```
32+
33+
Celo's transactions differ from Ethereum transactions by including 3 new fields:
34+
- `fee_currency`: The currency fees are paid in (None for CELO, otherwise it's an Address)
35+
- `gateway_fee_recipient`: The address of the fee recipient (None for no gateway fee paid)
36+
- `gateway_fee`: Gateway fee amount (None for no gateway fee paid)
37+
38+
The feature flag enables these additional fields in the transaction request builders and
39+
in the transactions which are fetched over JSON-RPC.
40+
2341
## Features
2442

2543
- [x] Ethereum JSON-RPC Client
@@ -28,6 +46,7 @@ ethers = { git = "github.com/gakonst/ethers-rs" }
2846
- [x] Querying past events
2947
- [x] Event monitoring as `Stream`s
3048
- [x] ENS as a first class citizen
49+
- [x] Celo support
3150
- [ ] Websockets / `eth_subscribe`
3251
- [ ] Hardware Wallet Support
3352
- [ ] WASM Bindings

Diff for: ethers-contract/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ once_cell = { version = "1.3.1", default-features = false }
1919
futures = "0.3.5"
2020

2121
[dev-dependencies]
22+
ethers = { version = "0.1.0", path = "../ethers" }
2223
tokio = { version = "0.2.21", default-features = false, features = ["macros"] }
2324
serde_json = "1.0.55"
25+
serial_test = "0.4.0"
2426

2527
[features]
2628
abigen = ["ethers-contract-abigen", "ethers-contract-derive"]
29+
celo = ["ethers-core/celo", "ethers-core/celo", "ethers-providers/celo", "ethers-signers/celo"]

Diff for: ethers-contract/src/factory.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ use ethers_signers::{Client, Signer};
1010
#[derive(Debug, Clone)]
1111
/// Helper which manages the deployment transaction of a smart contract
1212
pub struct Deployer<'a, P, S> {
13+
/// The deployer's transaction, exposed for overriding the defaults
14+
pub tx: TransactionRequest,
1315
abi: Abi,
1416
client: &'a Client<P, S>,
15-
tx: TransactionRequest,
1617
confs: usize,
1718
}
1819

0 commit comments

Comments
 (0)