Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs + improve tests speed #196

Merged
merged 1 commit into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Thank you for your interest in contributing to Elixir Ethers! We welcome contrib
2. Clone the repository
3. Install and Run `anvil` (From https://getfoundry.sh/)
4. Install dependencies with `mix deps.get`
5. Run tests with `mix test`
5. Prepare the tests (only needs to be ran once) with `mix run test/test_prepare.exs`
6. Run tests with `mix test`

## Pull Request Guidelines

Expand All @@ -35,4 +36,4 @@ If you have questions or run into issues, please open a GitHub issue with a clea

## License

By contributing to Elixir Ethers, you agree that your contributions will be licensed under its [License](/LICENSE).
By contributing to Elixir Ethers, you agree that your contributions will be licensed under its [License](/LICENSE).
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,12 @@ npm install -g solc
> anvil
```

- Prepare the tests (only needs to be ran once)

```
> mix run test/test_prepare.exs
```

Then you should be able to run tests through `mix test`.

## Acknowledgements
Expand Down
2 changes: 1 addition & 1 deletion test/ethers/ccip_read_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defmodule Ethers.CcipReadTest do

@from "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"

setup do
setup_all do
address = deploy(CcipReadTestContract, from: @from)
[address: address]
end
Expand Down
2 changes: 1 addition & 1 deletion test/ethers/contract_helpers_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Ethers.ContractHelpersTest do
use ExUnit.Case
use ExUnit.Case, async: true
alias Ethers.ContractHelpers

describe "read_abi" do
Expand Down
2 changes: 1 addition & 1 deletion test/ethers/event_argument_types_contract_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Ethers.Contract.Test.EventArgumentTypesContract do
end

defmodule Ethers.EventArgumentTypesContractTest do
use ExUnit.Case
use ExUnit.Case, async: true

alias Ethers.Contract.Test.EventArgumentTypesContract

Expand Down
2 changes: 1 addition & 1 deletion test/ethers/event_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Ethers.EventTest do
use ExUnit.Case
use ExUnit.Case, async: true
alias Ethers.Event
doctest Event

Expand Down
2 changes: 1 addition & 1 deletion test/ethers/multi_clause_contract_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Ethers.MultiClauseContractTest do

@from "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"

setup :deploy_multi_clause_contract
setup_all :deploy_multi_clause_contract

describe "next function" do
test "will raise on ambiguous arguments" do
Expand Down
3 changes: 1 addition & 2 deletions test/ethers/multicall_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ defmodule Ethers.MulticallTest do
alias Ethers.Multicall

@from "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"
setup_all :deploy_contracts

describe "multicall" do
setup :deploy_contracts

test "aggregate3 with no default address using Ethers.call", %{
counter_address: counter_address,
hello_world_address: hello_world_address
Expand Down
2 changes: 1 addition & 1 deletion test/ethers/name_service_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Ethers.NameServiceTest do
use ExUnit.Case
use ExUnit.Case, async: true
alias Ethers.NameService
doctest NameService
end
2 changes: 1 addition & 1 deletion test/ethers/pay_ether_contract_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Ethers.PayEtherContractTest do

@from "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"

setup :deploy_pay_ether_contract
setup_all :deploy_pay_ether_contract

describe "pay functions" do
test "can pay payable functions", %{address: address} do
Expand Down
4 changes: 2 additions & 2 deletions test/ethers/revert_contract_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Ethers.RevertContractTest do
use ExUnit.Case
use ExUnit.Case, async: true

import Ethers.TestHelpers

Expand All @@ -8,7 +8,7 @@ defmodule Ethers.RevertContractTest do

@from "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266"

setup :deploy_revert_contract
setup_all :deploy_revert_contract

describe "using require" do
test "will cause a revert including revert message", %{address: address} do
Expand Down
2 changes: 1 addition & 1 deletion test/ethers/signer/local_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Ethers.Signer.LocalTest do
use ExUnit.Case
use ExUnit.Case, async: true

alias Ethers.Signer
alias Ethers.Transaction.Eip1559
Expand Down
2 changes: 1 addition & 1 deletion test/ethers/transaction_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Ethers.TransactionTest do
use ExUnit.Case
use ExUnit.Case, async: true

alias Ethers.Transaction
alias Ethers.Utils
Expand Down
2 changes: 1 addition & 1 deletion test/ethers/tx_data_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Ethers.TxDataTest do
use ExUnit.Case
use ExUnit.Case, async: true

alias Ethers.TxData

Expand Down
2 changes: 1 addition & 1 deletion test/ethers/types_contract_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Ethers.Contract.Test.TypesContract do
end

defmodule Ethers.TypesContractTest do
use ExUnit.Case
use ExUnit.Case, async: true
doctest Ethers.Contract

import Ethers.TestHelpers
Expand Down
2 changes: 1 addition & 1 deletion test/ethers/types_test.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Ethers.TypesTest do
use ExUnit.Case
use ExUnit.Case, async: true
alias Ethers.Types
doctest Ethers.Types

Expand Down
2 changes: 1 addition & 1 deletion test/ethers_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule Ethers.Contract.Test.HelloWorldWithDefaultAddressContract do
end

defmodule EthersTest do
use ExUnit.Case
use ExUnit.Case, async: true
doctest Ethers

import Ethers.TestHelpers
Expand Down
Loading