Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Feb 9, 2025
1 parent 39c7f67 commit c212545
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/java/com/esaulpaugh/headlong/abi/ABIJSONTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.junit.jupiter.api.Test;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import java.math.BigInteger;
Expand Down Expand Up @@ -957,7 +958,7 @@ public void testParseABIField() {
}

@Test
public void testInputStreamParse() {
public void testInputStreamParse() throws IOException {
testABIObject(FUNCTION_A_JSON);
testABIObject(EVENT_STR);
testABIObject(ERROR_JSON);
Expand All @@ -970,6 +971,9 @@ public void testInputStreamParse() {

ContractError<Pair<BigInteger, Integer>> err = ContractError.fromJson(FLAGS_NONE, bais(ERROR_JSON));
assertEquals(ERROR_JSON, err.toJson(true));

InputStream abi = TestUtils.getFileResource("tests/headlong/tests/abi.json");
assertEquals(4, new ABIParser().parse(abi).size());
}

private static void testABIObject(String json) {
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/tests/headlong/tests/abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name":""},{"type":"receive","stateMutability":"payable"},{"type":"fallback"},{"type":"constructor"}]

0 comments on commit c212545

Please sign in to comment.