Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
elgatovital committed Aug 28, 2023
1 parent 69ea8e2 commit acd2092
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions data/src/main/java/io/gnosis/data/backend/rpc/RpcClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,13 @@ class RpcClient(
}

private fun removeFee(tx: Transaction) {
when(tx) {
when (tx) {
is Transaction.Eip1559 -> {
tx.gas = null
tx.maxPriorityFee = null
tx.maxFeePerGas = null
}

is Transaction.Legacy -> {
tx.gas = null
tx.gasPrice = null
Expand All @@ -212,18 +213,20 @@ class RpcClient(
val balanceRequest = EthBalance(address = tx.from!!, id = 2)
val nonceRequest = EthGetTransactionCount(from = tx.from!!, id = 3)

val callRequest = when(tx) {
val callRequest = when (tx) {
is Transaction.Eip1559 -> {
EthCallEip1559(from = tx.from, transaction = tx, id = 4)
}

is Transaction.Legacy -> {
EthCall(from = tx.from, transaction = tx, id = 4)
}
}
val estimateRequest = when(tx) {
val estimateRequest = when (tx) {
is Transaction.Eip1559 -> {
EthEstimateGasEip1559(from = tx.from, transaction = tx, id = 5)
}

is Transaction.Legacy -> {
EthEstimateGas(from = tx.from, transaction = tx, id = 5)
}
Expand Down Expand Up @@ -261,6 +264,7 @@ class RpcClient(
is Transaction.Eip1559 -> {
byteArrayOf(tx.type, *tx.rlp(signature))
}

is Transaction.Legacy -> {
tx.rlp(signature)
}
Expand Down

0 comments on commit acd2092

Please sign in to comment.