Integrate rx/receipts gold bounds (#781)

This commit is contained in:
KirillPamPam
2026-01-28 12:54:50 +04:00
committed by GitHub
parent 2e4c99b202
commit 3b5940cc20
14 changed files with 374 additions and 12 deletions

View File

@@ -1,12 +1,13 @@
package org.drpc.chainsconfig
import io.emeraldpay.dshackle.config.ChainsConfig
import io.emeraldpay.dshackle.config.ChainsConfigReader
import io.emeraldpay.dshackle.foundation.ChainOptionsReader
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.math.BigInteger
internal class ChainsConfigReaderTest {
class ChainsConfigReaderTest {
@Test
fun `read standard config without custom`() {
@@ -41,5 +42,17 @@ internal class ChainsConfigReaderTest {
assertEquals(config.code, "FTA")
assertEquals(config.grpcId, 102)
assertEquals(config.netVersion, BigInteger.valueOf(251))
assertEquals(15L, config.goldLowerBounds[ChainsConfig.LowerBoundType.STATE]!!.block)
assertEquals(150L, config.goldLowerBounds[ChainsConfig.LowerBoundType.BLOCK]!!.block)
assertEquals(1L, config.goldLowerBounds[ChainsConfig.LowerBoundType.TX]!!.block)
assertEquals(
"0x5e77a04531c7c107af1882d76cbff9486d0a9aa53701c30888509d4f5f2b003a",
(config.goldLowerBounds[ChainsConfig.LowerBoundType.TX] as ChainsConfig.GoldLowerBoundWithHash).hash,
)
assertEquals(1000L, config.goldLowerBounds[ChainsConfig.LowerBoundType.RECEIPTS]!!.block)
assertEquals(
"0x4e72a04531c7c107af1882d76cbff9486d0a9aa53701c30888509d4f5f2b003a",
(config.goldLowerBounds[ChainsConfig.LowerBoundType.RECEIPTS] as ChainsConfig.GoldLowerBoundWithHash).hash,
)
}
}

View File

@@ -16,4 +16,15 @@ chain-settings:
short-names: [fantom]
code: FTA
grpcId: 102
chain-id: 0xfb
chain-id: 0xfb
lower-bounds:
tx:
block: 1
hash: "0x5e77a04531c7c107af1882d76cbff9486d0a9aa53701c30888509d4f5f2b003a"
receipts:
block: 1000
hash: "0x4e72a04531c7c107af1882d76cbff9486d0a9aa53701c30888509d4f5f2b003a"
state:
block: 15
block:
block: 150