From 585c09f8328ee8bb5cf078c327cf4d0fc3fcdd0e Mon Sep 17 00:00:00 2001 From: Osakpolor Obaseki Date: Fri, 16 Aug 2024 13:20:27 +0100 Subject: [PATCH] Fix linter error --- jsonrpc/server.go | 2 +- rpc/estimate_fee.go | 4 +++- rpc/trace.go | 3 ++- vm/rust/src/lib.rs | 8 +++++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/jsonrpc/server.go b/jsonrpc/server.go index 36d4e0a31b..a6d9ea12f4 100644 --- a/jsonrpc/server.go +++ b/jsonrpc/server.go @@ -213,7 +213,7 @@ type connection struct { w io.Writer activated <-chan struct{} - //todo: guard for this in the code! don't depend on devs finding out about this! + // todo: guard for this in the code! don't depend on devs finding out about this! // initialErr is not thread-safe. It must be set to its final value before the connection is activated. initialErr error } diff --git a/rpc/estimate_fee.go b/rpc/estimate_fee.go index a7e74e4b5d..55aebb5a4f 100644 --- a/rpc/estimate_fee.go +++ b/rpc/estimate_fee.go @@ -110,8 +110,10 @@ type estimateFeeHandler func(broadcastedTxns []BroadcastedTransaction, simulationFlags []SimulationFlag, id BlockID, ) ([]FeeEstimate, http.Header, *jsonrpc.Error) +//nolint:gocritic func (h *Handler) estimateMessageFee(msg MsgFromL1, id BlockID, f estimateFeeHandler) (*FeeEstimate, - http.Header, *jsonrpc.Error) { //nolint:gocritic + http.Header, *jsonrpc.Error, +) { calldata := make([]*felt.Felt, 0, len(msg.Payload)+1) // The order of the calldata parameters matters. msg.From must be prepended. calldata = append(calldata, new(felt.Felt).SetBytes(msg.From.Bytes())) diff --git a/rpc/trace.go b/rpc/trace.go index bf5d7b1c53..9bb9102523 100644 --- a/rpc/trace.go +++ b/rpc/trace.go @@ -140,7 +140,8 @@ func (h *Handler) TraceTransactionV0_6(ctx context.Context, hash felt.Felt) (*vm } func (h *Handler) traceTransaction(ctx context.Context, hash *felt.Felt, v0_6Response bool) (*vm.TransactionTrace, - http.Header, *jsonrpc.Error) { + http.Header, *jsonrpc.Error, +) { _, blockHash, _, err := h.bcReader.Receipt(hash) httpHeader := http.Header{} httpHeader.Set(ExecutionStepsHeader, "0") diff --git a/vm/rust/src/lib.rs b/vm/rust/src/lib.rs index 6dda009c55..f1aefd2b80 100644 --- a/vm/rust/src/lib.rs +++ b/vm/rust/src/lib.rs @@ -351,7 +351,13 @@ pub extern "C" fn cairoVMExecute( let actual_fee = t.transaction_receipt.fee.0.into(); let data_gas_consumed = t.transaction_receipt.da_gas.l1_data_gas.into(); - let execution_steps = t.transaction_receipt.resources.vm_resources.n_steps.try_into().unwrap_or(u64::MAX); + let execution_steps = t + .transaction_receipt + .resources + .vm_resources + .n_steps + .try_into() + .unwrap_or(u64::MAX); let trace = jsonrpc::new_transaction_trace(&txn_and_query_bit.txn, t, &mut txn_state);