Skip to content

Commit

Permalink
add response test as well
Browse files Browse the repository at this point in the history
  • Loading branch information
rvullriede committed Aug 2, 2023
1 parent 984e617 commit 004dbc7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion core/src/test/java/org/web3j/protocol/core/ResponseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.web3j.protocol.core.methods.response.DbPutHex;
import org.web3j.protocol.core.methods.response.DbPutString;
import org.web3j.protocol.core.methods.response.EthAccounts;
import org.web3j.protocol.core.methods.response.EthBaseFee;
import org.web3j.protocol.core.methods.response.EthBlock;
import org.web3j.protocol.core.methods.response.EthBlockNumber;
import org.web3j.protocol.core.methods.response.EthCall;
Expand Down Expand Up @@ -599,6 +600,19 @@ public void testEthEstimateGas() {
assertEquals(ethEstimateGas.getAmountUsed(), (BigInteger.valueOf(21000)));
}

@Test
public void testEthBaseFee() {
buildResponse(
"{\n"
+ " \"id\":1,\n"
+ " \"jsonrpc\": \"2.0\",\n"
+ " \"result\": \"0x5d21dba00\"\n"
+ "}");

EthBaseFee ethBaseFee = deserialiseResponse(EthBaseFee.class);
assertEquals(ethBaseFee.getBaseFee(), (BigInteger.valueOf(25000000000L)));
}

@Test
public void testEthBlockTransactionHashes() {

Expand Down Expand Up @@ -1796,4 +1810,4 @@ public void testTxPoolStatus() {
assertEquals(status.getPending(), 10);
assertEquals(status.getQueued(), 7);
}
}
}
2 changes: 1 addition & 1 deletion gradle/publish/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ signing {
if (signingKey.exists()) {
useInMemoryPgpKeys(signingKey.getText('UTF-8'), System.getenv('GPG_PASSPHRASE'))
}
}
}

0 comments on commit 004dbc7

Please sign in to comment.