From 0822cbf439882b6317f6f6734af0ae3184a4b532 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 28 Feb 2024 16:04:20 +0400 Subject: [PATCH] Fix linter issues --- node/throttled_vm.go | 4 +++- vm/vm.go | 16 +++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/node/throttled_vm.go b/node/throttled_vm.go index a68cc2b032..1befa1766c 100644 --- a/node/throttled_vm.go +++ b/node/throttled_vm.go @@ -19,7 +19,9 @@ func NewThrottledVM(res vm.VM, concurrenyBudget uint, maxQueueLen int32) *Thrott } } -func (tvm *ThrottledVM) Call(callInfo *vm.CallInfo, blockInfo *vm.BlockInfo, state core.StateReader, network *utils.Network, maxSteps uint64) ([]*felt.Felt, error) { +func (tvm *ThrottledVM) Call(callInfo *vm.CallInfo, blockInfo *vm.BlockInfo, state core.StateReader, + network *utils.Network, maxSteps uint64, +) ([]*felt.Felt, error) { var ret []*felt.Felt return ret, tvm.Do(func(vm *vm.VM) error { var err error diff --git a/vm/vm.go b/vm/vm.go index 636a5b91a8..f785766053 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -142,12 +142,12 @@ type BlockInfo struct { BlockHashToBeRevealed *felt.Felt } -func copyFeltIntoCArray(felt *felt.Felt, cArrPtr *C.uchar) { - if felt == nil { +func copyFeltIntoCArray(f *felt.Felt, cArrPtr *C.uchar) { + if f == nil { return } - feltBytes := felt.Bytes() + feltBytes := f.Bytes() cArr := unsafe.Slice(cArrPtr, len(feltBytes)) for index := range feltBytes { cArr[index] = C.uchar(feltBytes[index]) @@ -191,7 +191,9 @@ func makeCBlockInfo(blockInfo *BlockInfo) C.BlockInfo { return cBlockInfo } -func (v *vm) Call(callInfo *CallInfo, blockInfo *BlockInfo, state core.StateReader, network *utils.Network, maxSteps uint64) ([]*felt.Felt, error) { +func (v *vm) Call(callInfo *CallInfo, blockInfo *BlockInfo, state core.StateReader, + network *utils.Network, maxSteps uint64, +) ([]*felt.Felt, error) { context := &callContext{ state: state, response: []*felt.Felt{}, @@ -208,7 +210,7 @@ func (v *vm) Call(callInfo *CallInfo, blockInfo *BlockInfo, state core.StateRead &cBlockInfo, C.uintptr_t(handle), chainID, - C.ulonglong(maxSteps), + C.ulonglong(maxSteps), //nolint:gocritic ) callInfoPinner.Unpin() C.free(unsafe.Pointer(chainID)) @@ -276,7 +278,7 @@ func (v *vm) Execute(txns []core.Transaction, declaredClasses []core.Class, paid C.uchar(skipChargeFeeByte), C.uchar(skipValidateByte), C.uchar(errOnRevertByte), - C.uchar(legacyTraceJSONByte), + C.uchar(legacyTraceJSONByte), //nolint:gocritic ) C.free(unsafe.Pointer(classesJSONCStr)) @@ -305,7 +307,7 @@ func (v *vm) Execute(txns []core.Transaction, declaredClasses []core.Class, paid return context.actualFees, traces, nil } -func marshalTxnsAndDeclaredClasses(txns []core.Transaction, declaredClasses []core.Class) (json.RawMessage, json.RawMessage, error) { +func marshalTxnsAndDeclaredClasses(txns []core.Transaction, declaredClasses []core.Class) (json.RawMessage, json.RawMessage, error) { //nolint:lll txnJSONs := []json.RawMessage{} for _, txn := range txns { txnJSON, err := marshalTxn(txn)