Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3a3e409

Browse files
committed
[2.0.0-SNAPSHOT]
Tests reinforced
1 parentbf30d9a commit3a3e409

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
publicStringtoString() {
43-
return"GasEstimate{" +
44-
"duration=" +duration +
45-
'}';
43+
returnduration.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+
GasOraclevalue2 =GasOracle.builder()
84+
.withFastGasPrice(Wei.ofWei(1000000000))
85+
.withProposeGasPrice(Wei.ofWei(1000000000))
86+
.withSafeGasPrice(Wei.ofWei(1000000000))
87+
.withGasUsedRatio(Collections.singletonList(newBigDecimal(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+
EthSupplyvalue2 =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+
voidgasEstimate() {
396+
GasEstimategas1 =newGasEstimate(1);
397+
GasEstimategas2 =newGasEstimate(1);
398+
assertEquals(gas1,gas2);
399+
assertEquals(gas1.hashCode(),gas2.hashCode());
400+
assertEquals(gas1.toString(),gas2.toString());
401+
}
371402
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp