Skip to content

Commit

Permalink
fix: test_call_a_view_contract test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Aviksaikat committed Jul 14, 2024
1 parent 0d314d4 commit 34e627d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Once installed, you can use the ape_utils command to call view functions on Ethe
![help](media/help.png)

```sh
ape_utils call --function-sig "function_signature" --address "contract_address" --args argument --network [ecosystem-name][:[network-name][:[provider-name]]]
ape_utils call --function-sig "function_signature" --address "contract_address" --args [argument] --network [ecosystem-name][:[network-name][:[provider-name]]]
```
### Examples
Expand All @@ -55,7 +55,7 @@ To call a view function with the signature `call_this_view_function(uint256)(str
```bash
# function which takes a single input parameter
ape_utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args 6147190 --network :sepolia:infura
ape_utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args '[6147190]' --network :sepolia:infura
```
#### Calling a view function with multiple parameter
Expand All @@ -74,7 +74,7 @@ ape_utils call --function-sig 'multiple_param_function(uint256,string,address)(s
```bash
ape utils --help
ape utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args 6147190 --network :sepolia:infura
ape utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args '[6147190]' --network :sepolia:infura
```
#### ABI encode the given function
Expand Down
4 changes: 2 additions & 2 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To call a view function with the signature `call_this_view_function(uint256)(str

```bash
# function which takes a single input parameter
ape_utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args 6147190 --network :sepolia:infura
ape_utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args '[6147190]' --network :sepolia:infura
```

#### Calling a view function with multiple parameter
Expand All @@ -25,7 +25,7 @@ ape_utils call --function-sig 'multiple_param_function(uint256,string,address)(s

```bash
ape utils --help
ape utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args 6147190 --network :sepolia:infura
ape utils call --function-sig "call_this_view_function(uint256)(string)" --address "0x80E097a70cacA11EB71B6401FB12D48A1A61Ef54" --args '[6147190]' --network :sepolia:infura
```

#### ABI encode the given function
Expand Down
2 changes: 1 addition & 1 deletion tests/test_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@


def test_call_a_view_contract(runner: CliRunner, cli: rclick.RichGroup) -> None:
result = runner.invoke(cli, ["call", "--function-sig", "call_this_view_function(uint256 arg1)", "--address","0x80E097a70CACA11EB71B6401FB12D48A1A61Ef54", "--args", "6147190", "--network", ":sepolia"])
result = runner.invoke(cli, ["call", "--function-sig", "call_this_view_function(uint256)(string)", "--address","0x80E097a70CACA11EB71B6401FB12D48A1A61Ef54", "--args", "[6147190]", "--network", ":sepolia"])
# print(result)
assert result.exit_code == 0

0 comments on commit 34e627d

Please sign in to comment.