enables stylecheck (#36)

* enables stylecheck

* applies style check

* Applying style check

* uses alias to fix ambiguity
This commit is contained in:
Ben Bierens 2023-03-09 10:58:54 +01:00 committed by GitHub
parent e462649aec
commit 577e02b8a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 7 deletions

View File

@ -1,3 +1,6 @@
--styleCheck:usages
--styleCheck:error
# begin Nimble config (version 1)
when fileExists("nimble.paths"):
include "nimble.paths"

View File

@ -37,7 +37,7 @@ func fitsInIndexedField(T: type): bool {.compileTime.} =
solidityType(T) in supportedTypes
func decode*[E: Event](_: type E, data: seq[byte], topics: seq[Topic]): ?!E =
var event = ?Abidecoder.decode(data, E)
var event = ?AbiDecoder.decode(data, E)
var i = 1
for field in event.fields:
if field.hasCustomPragma(indexed):

View File

@ -129,7 +129,7 @@ method call*(provider: JsonRpcProvider,
method getGasPrice*(provider: JsonRpcProvider): Future[UInt256] {.async.} =
convertError:
let client = await provider.client
return await client.eth_gasprice()
return await client.eth_gasPrice()
method getTransactionCount*(provider: JsonRpcProvider,
address: Address,

View File

@ -3,7 +3,7 @@ import eth/rlp
import eth/common
import eth/common/transaction as ct
import ./provider
import ./transaction
import ./transaction as tx
import ./signer
export keys
@ -64,7 +64,7 @@ proc signTransaction(tr: var SignableTransaction, pk: PrivateKey) =
let r = toRaw(s)
let v = r[64]
tr.R = fromBytesBe(UInt256, r.toOpenArray(0, 31))
tr.R = fromBytesBE(UInt256, r.toOpenArray(0, 31))
tr.S = fromBytesBE(UInt256, r.toOpenArray(32, 63))
case tr.txType:
@ -76,7 +76,7 @@ proc signTransaction(tr: var SignableTransaction, pk: PrivateKey) =
else:
raise newException(WalletError, "Transaction type not supported")
proc signTransaction*(wallet: Wallet, tx: transaction.Transaction): Future[seq[byte]] {.async.} =
proc signTransaction*(wallet: Wallet, tx: tx.Transaction): Future[seq[byte]] {.async.} =
if sender =? tx.sender and sender != wallet.address:
raise newException(WalletError, "from address mismatch")
@ -101,10 +101,10 @@ proc signTransaction*(wallet: Wallet, tx: transaction.Transaction): Future[seq[b
s.to = some EthAddress(tx.to)
s.payload = tx.data
signTransaction(s, wallet.privateKey)
return rlp.encode(s)
method sendTransaction*(wallet: Wallet, tx: transaction.Transaction): Future[TransactionResponse] {.async.} =
method sendTransaction*(wallet: Wallet, tx: tx.Transaction): Future[TransactionResponse] {.async.} =
let rawTX = await signTransaction(wallet, tx)
return await provider(wallet).sendTransaction(rawTX)