fix specific methods

This commit is contained in:
Maksim Fomenkov
2022-11-23 06:02:21 +04:00
parent fc9f7e0fa6
commit b26dd989f5
3 changed files with 34 additions and 32 deletions

View File

@@ -44,4 +44,29 @@ class DefaultEthereumMethodsSpec extends Specification {
Chain.TESTNET_RINKEBY | '"0x4"'
Chain.TESTNET_ROPSTEN | '"0x3"'
}
def "Optimism chain unsupported methods"() {
setup:
def methods = new DefaultEthereumMethods(Chain.OPTIMISM)
when:
def acc = methods.isAvailable("eth_getAccounts")
def trans = methods.isAvailable("eth_sendTransaction")
then:
!acc
!trans
}
def "Has supported specific methods"() {
expect:
new DefaultEthereumMethods(chain).getSupportedMethods().containsAll(methods)
where:
chain | methods
Chain.POLYGON | ["bor_getAuthor",
"bor_getCurrentValidators",
"bor_getCurrentProposer",
"bor_getRootHash",
"bor_getSignersAtHash",
"eth_getRootHash"]
Chain.OPTIMISM | ["eth_getBlockRange", "rollup_gasPrices"]
}
}