From 73cd07183e89e65941ffc68481cc2a0d12e71b55 Mon Sep 17 00:00:00 2001 From: nuxtreact Date: Fri, 13 Feb 2026 00:28:29 +0800 Subject: [PATCH] chore: fix some minor issues in the comments Signed-off-by: nuxtreact --- pkg/api/node_api.go | 4 ++-- pkg/miner/micro_miner.go | 2 +- pkg/proto/block.go | 2 +- pkg/proto/eth_typed_data.go | 2 +- pkg/proto/ethabi/function_signature.go | 2 +- pkg/ride/compiler/stdlib/structs.go | 2 +- pkg/ride/functions_strings.go | 4 ++-- pkg/ride/tree_evaluation_test.go | 10 +++++----- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/api/node_api.go b/pkg/api/node_api.go index 2c20aa7ee8..2af53cb673 100644 --- a/pkg/api/node_api.go +++ b/pkg/api/node_api.go @@ -245,7 +245,7 @@ func (a *NodeApi) BlockAt(w http.ResponseWriter, r *http.Request) error { height, err := strconv.ParseUint(s, 10, 64) if err != nil { // nickeskov: message taken from scala node - // try execute `curl -X GET "https://nodes-testnet.wavesnodes.com/blocks/at/fdsfasdff" -H "accept: application/json"` + // try execute `curl -X GET "https://nodes-testnet.wavesnodes.com/blocks/at/fdsfasdff" -H "accept: application/json"` return blockIDAtInvalidLenErr("at", err) } @@ -581,7 +581,7 @@ func (a *NodeApi) NodeStatus(w http.ResponseWriter, _ *http.Request) error { blockHeader := a.state.TopBlock() updatedTimestampMillis := int64(blockHeader.Timestamp) - // TODO: meaning of 'UpdatedDate' in scala node differs from ours + // TODO: meaning of 'UpdatedDate' in scala node differs from ours out := resp{ BlockchainHeight: stateHeight, StateHeight: stateHeight, diff --git a/pkg/miner/micro_miner.go b/pkg/miner/micro_miner.go index ddeb5d60d7..096bedd210 100644 --- a/pkg/miner/micro_miner.go +++ b/pkg/miner/micro_miner.go @@ -168,7 +168,7 @@ func (a *MicroMiner) Micro(minedBlock *proto.Block, rest proto.MiningLimits, key // no transactions applied, skip if txCount == 0 { // TODO: we should distinguish between block is full because of size or because of complexity - // limit reached. For now we return the same error. + // limit reached. For now we return the same error. if len(inapplicable) > 0 || rest.MaxTxsSizeInBytes-binSize < minTransactionSize { return nil, nil, rest, ErrBlockIsFull } diff --git a/pkg/proto/block.go b/pkg/proto/block.go index c54011ce2e..f056a86434 100644 --- a/pkg/proto/block.go +++ b/pkg/proto/block.go @@ -893,7 +893,7 @@ func (b *Block) WriteToWithoutSignature(w io.Writer, scheme Scheme) (int64, erro // UnmarshalBinary decodes Block from binary form func (b *Block) UnmarshalBinary(data []byte, scheme Scheme) (err error) { // TODO make benchmarks to figure out why multiple length checks slow down that much - // and (probably) get rid of recover(). + // and (probably) get rid of recover(). defer func() { if recover() != nil { err = errors.New("invalid data size") diff --git a/pkg/proto/eth_typed_data.go b/pkg/proto/eth_typed_data.go index 1dc6cc939f..ecfa1bfa65 100644 --- a/pkg/proto/eth_typed_data.go +++ b/pkg/proto/eth_typed_data.go @@ -142,7 +142,7 @@ func (typedData *ethereumTypedData) EncodeType(primaryType string) []byte { return buffer.Bytes() } -// TypeHash creates the keccak256 hash of the data +// TypeHash creates the keccak256 hash of the data func (typedData *ethereumTypedData) TypeHash(primaryType string) []byte { return crypto.MustKeccak256(typedData.EncodeType(primaryType)).Bytes() } diff --git a/pkg/proto/ethabi/function_signature.go b/pkg/proto/ethabi/function_signature.go index 986595de82..b9fe33b824 100644 --- a/pkg/proto/ethabi/function_signature.go +++ b/pkg/proto/ethabi/function_signature.go @@ -82,7 +82,7 @@ func rideMetaTypeToTextMarshaler(metaT meta.Type) (encoding.TextMarshaler, error case meta.SimpleType: switch t { case meta.Int: - // it's RideInt type + // it's RideInt type marshaler := intTextBuilder{ size: 64, unsigned: false, diff --git a/pkg/ride/compiler/stdlib/structs.go b/pkg/ride/compiler/stdlib/structs.go index 31744fe83b..1f3a97d888 100644 --- a/pkg/ride/compiler/stdlib/structs.go +++ b/pkg/ride/compiler/stdlib/structs.go @@ -155,7 +155,7 @@ func appendRemainingStructs(s *rideObjects) { s.Objects = append(s.Objects, remainingObjects...) } -// This is need because in ride_object in some cases exist rideType(interface) in types +// This is needed because in ride_object in some cases exist rideType(interface) in types func changeRideTypeFields(name string, fields []actionField) []actionField { switch name { case "Order": diff --git a/pkg/ride/functions_strings.go b/pkg/ride/functions_strings.go index 6ed7170cff..eeb51ca687 100644 --- a/pkg/ride/functions_strings.go +++ b/pkg/ride/functions_strings.go @@ -471,7 +471,7 @@ func runesDrop(s string, n int) string { return res } -// This is the CORRECT implementation of takeString function that handles runes in UTF-8 string correct +// This is the CORRECT implementation of takeString function that handles runes in UTF-8 string correctly func runesTake(s string, n int) string { out := make([]rune, n) copy(out, []rune(s)[:n]) @@ -484,7 +484,7 @@ func takeRideString(s string, n int) rideString { return rideString(runesTake(s, t)) } -// This is the WRONG implementation of takeString function that handles runes in UTF-8 string INCORRECT +// This is the WRONG implementation of takeString function that handles runes in UTF-8 string incorrectly func takeRideStringWrong(s string, n int) rideString { b := utf16.Encode([]rune(s)) l := len(b) diff --git a/pkg/ride/tree_evaluation_test.go b/pkg/ride/tree_evaluation_test.go index bffb580e53..f6cc2fb9d0 100644 --- a/pkg/ride/tree_evaluation_test.go +++ b/pkg/ride/tree_evaluation_test.go @@ -5389,9 +5389,9 @@ func TestInvokePaymentsCheckBeforeAndAfterInvoke(t *testing.T) { assert.Nil(t, res) assert.EqualError(t, err, "gotcha") assert.Equal(t, UserError, GetEvaluationErrorType(err)) - // the calls happen in `WrappedState.validatePaymentAction` during payment application and before invoke - // in `performInvoke` function - // in `checkPaymentsApplication` inside `WrappedState.validateBalancesAfterPaymentsApplication` + // the calls happen in `WrappedState.validatePaymentAction` during payment application and before invoke + // in `performInvoke` function + // in `checkPaymentsApplication` inside `WrappedState.validateBalancesAfterPaymentsApplication` // payments check after application are not second time because of throw assert.Len(t, rideEnv.calls.validateInternalPayments, 2) }) @@ -5403,8 +5403,8 @@ func TestInvokePaymentsCheckBeforeAndAfterInvoke(t *testing.T) { assert.EqualError(t, err, "invoke: failed to apply attached payments: not enough money in the DApp, balance of asset WAVES on address 3MzDtgL5yw73C2xVLnLJCrT5gCL4357a4sz after payments application is -4900000000: negative balance after payments application") //nolint:lll assert.Equal(t, EvaluationFailure, GetEvaluationErrorType(err)) // the calls happen in `WrappedState.validatePaymentAction` during payment application and before invoke - // in `performInvoke` function - // in `checkPaymentsApplication` inside `WrappedState.validateBalancesAfterPaymentsApplication` + // in `performInvoke` function + // in `checkPaymentsApplication` inside `WrappedState.validateBalancesAfterPaymentsApplication` // successfully fails before invoke because of negative balance assert.Len(t, rideEnv.calls.validateInternalPayments, 2) })