@@ -15,7 +15,9 @@ class OracleTests: XCTestCase {
1515
1616 let web3 = Web3 . InfuraMainnetWeb3 ( accessToken: Constants . infuraToken)
1717
18- lazy var oracle : Web3 . Oracle = . init( web3, block: . exact( 14571792 ) , blockCount: 20 , percentiles: [ 10 , 40 , 60 , 90 ] )
18+ let blockNumber : BigUInt = 14571792
19+
20+ lazy var oracle : Web3 . Oracle = . init( web3, block: . exact( blockNumber) , blockCount: 20 , percentiles: [ 10 , 40 , 60 , 90 ] )
1921
2022 func testPretictBaseFee( ) throws {
2123 let etalonPercentiles : [ BigUInt ] = [
@@ -64,13 +66,24 @@ class OracleTests: XCTestCase {
6466
6567 func testPredictLegacyGasPrice( ) throws {
6668 let etalonPercentiles : [ BigUInt ] = [
67- 100474449775 , // 10 percentile
68- 114000000000 , // 40 percentile
69- 125178275323 , // 60 percentile
70- 146197706224 // 90 percentile
69+ 93253857566 , // 10 percentile
70+ 106634912620 , // 40 percentile
71+ 111000000000 , // 60 percentile
72+ 127210686305 // 90 percentile
7173 ]
7274
7375 let gasPriceLegacyPercentiles = oracle. gasPriceLegacyPercentiles
7476 XCTAssertEqual ( gasPriceLegacyPercentiles, etalonPercentiles, " Arrays should be equal " )
7577 }
78+
79+ func testAllTransactionInBlockDecodesWell( ) throws {
80+ let blockWithTransaction = try web3. eth. getBlockByNumber ( blockNumber, fullTransactions: true )
81+
82+ let nullTransactions = blockWithTransaction. transactions. filter {
83+ guard case . null = $0 else { return false }
84+ return true
85+ }
86+
87+ XCTAssert ( nullTransactions. isEmpty, " This amount transaction fails to decode: \( nullTransactions. count) " )
88+ }
7689}
0 commit comments