Skip to content

Commit 3a3e409

Browse files
committed
[2.0.0-SNAPSHOT]
Tests reinforced
1 parent bf30d9a commit 3a3e409

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

src/main/java/io/goodforgod/api/etherscan/model/GasEstimate.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ public int hashCode() {
4040

4141
@Override
4242
public String toString() {
43-
return "GasEstimate{" +
44-
"duration=" + duration +
45-
'}';
43+
return duration.toString();
4644
}
4745
}

src/test/java/io/goodforgod/api/etherscan/model/ModelBuilderTests.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ void gasOracleBuilder() {
7979

8080
assertNotNull(value);
8181
assertEquals(Wei.ofWei(1000000000), value.getFastGasPriceInWei());
82+
83+
GasOracle value2 = GasOracle.builder()
84+
.withFastGasPrice(Wei.ofWei(1000000000))
85+
.withProposeGasPrice(Wei.ofWei(1000000000))
86+
.withSafeGasPrice(Wei.ofWei(1000000000))
87+
.withGasUsedRatio(Collections.singletonList(new BigDecimal(1)))
88+
.withLastBlock(1L)
89+
.withSuggestBaseFee(1.0)
90+
.build();
91+
assertEquals(value, value2);
92+
assertEquals(value.hashCode(), value2.hashCode());
93+
assertEquals(value.toString(), value2.toString());
8294
}
8395

8496
@Test
@@ -289,6 +301,16 @@ void ethSupplyBuilder() {
289301
.build();
290302
assertNotNull(valueEmpty);
291303
assertEquals(BigInteger.ZERO, valueEmpty.getTotal().asWei());
304+
305+
EthSupply value2 = EthSupply.builder()
306+
.withBurntFees(Wei.ofWei(1))
307+
.withEth2Staking(Wei.ofWei(1))
308+
.withEthSupply(Wei.ofWei(1))
309+
.withWithdrawnTotal(Wei.ofWei(1))
310+
.build();
311+
assertEquals(value, value2);
312+
assertEquals(value.hashCode(), value2.hashCode());
313+
assertEquals(value.toString(), value2.toString());
292314
}
293315

294316
@Test
@@ -368,4 +390,13 @@ void blockProxyBuilder() {
368390
assertNotNull(value);
369391
assertEquals(BigInteger.valueOf(1), value.getGasUsed().asWei());
370392
}
393+
394+
@Test
395+
void gasEstimate() {
396+
GasEstimate gas1 = new GasEstimate(1);
397+
GasEstimate gas2 = new GasEstimate(1);
398+
assertEquals(gas1, gas2);
399+
assertEquals(gas1.hashCode(), gas2.hashCode());
400+
assertEquals(gas1.toString(), gas2.toString());
401+
}
371402
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy