From 64b5ba24e93147010b0d8140db20a5bf346cf4a2 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 21 Nov 2023 13:47:59 +0300 Subject: [PATCH] *: fix `less then` typos everywhere My poor grammar... Signed-off-by: Anna Shaleva --- pkg/core/native/native_test/notary_test.go | 16 ++++++++-------- pkg/core/native/notary.go | 6 +++--- pkg/services/rpcsrv/server.go | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/core/native/native_test/notary_test.go b/pkg/core/native/native_test/notary_test.go index 9f08f6333..25cae19d8 100644 --- a/pkg/core/native/native_test/notary_test.go +++ b/pkg/core/native/native_test/notary_test.go @@ -79,13 +79,13 @@ func TestNotary_Pipeline(t *testing.T) { neoCommitteeInvoker.InvokeFail(t, "only GAS can be accepted for deposit", "transfer", multisigHash, notaryHash, int64(1), ¬ary.OnNEP17PaymentData{Till: uint32(depositLock)}) // `onPayment`: insufficient first deposit - gasCommitteeInvoker.InvokeFail(t, "first deposit can not be less then", "transfer", multisigHash, notaryHash, int64(2*feePerKey-1), ¬ary.OnNEP17PaymentData{Till: uint32(depositLock)}) + gasCommitteeInvoker.InvokeFail(t, "first deposit can not be less than", "transfer", multisigHash, notaryHash, int64(2*feePerKey-1), ¬ary.OnNEP17PaymentData{Till: uint32(depositLock)}) // `onPayment`: invalid `data` (missing `till` parameter) gasCommitteeInvoker.InvokeFail(t, "`data` parameter should be an array of 2 elements", "transfer", multisigHash, notaryHash, 2*feePerKey, []any{nil}) // `onPayment`: invalid `data` (outdated `till` parameter) - gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less then the chain's height", "transfer", multisigHash, notaryHash, 2*feePerKey, ¬ary.OnNEP17PaymentData{}) + gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the chain's height", "transfer", multisigHash, notaryHash, 2*feePerKey, ¬ary.OnNEP17PaymentData{}) // `onPayment`: good gasCommitteeInvoker.Invoke(t, true, "transfer", multisigHash, notaryHash, 2*feePerKey, ¬ary.OnNEP17PaymentData{Till: uint32(depositLock)}) @@ -107,13 +107,13 @@ func TestNotary_Pipeline(t *testing.T) { // `expirationOf`: check `till` is updated. notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash) - // `onPayment`: empty payment, should fail because `till` less then the previous one - gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less then the previous value", "transfer", multisigHash, notaryHash, int64(0), ¬ary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(depositLock)}) + // `onPayment`: empty payment, should fail because `till` less than the previous one + gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the previous value", "transfer", multisigHash, notaryHash, int64(0), ¬ary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(depositLock)}) checkBalanceOf(t, notaryHash, 3*feePerKey) notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash) - // `onPayment`: empty payment, should fail because `till` less then the chain height - gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less then the chain's height", "transfer", multisigHash, notaryHash, int64(0), ¬ary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(1)}) + // `onPayment`: empty payment, should fail because `till` less than the chain height + gasCommitteeInvoker.InvokeFail(t, "`till` shouldn't be less than the chain's height", "transfer", multisigHash, notaryHash, int64(0), ¬ary.OnNEP17PaymentData{Account: &multisigHash, Till: uint32(1)}) checkBalanceOf(t, notaryHash, 3*feePerKey) notaryCommitteeInvoker.Invoke(t, depositLock+1, "expirationOf", multisigHash) @@ -126,11 +126,11 @@ func TestNotary_Pipeline(t *testing.T) { notaryCommitteeInvoker.Invoke(t, false, "lockDepositUntil", util.Uint160{1, 2, 3}, int64(depositLock+3)) notaryCommitteeInvoker.Invoke(t, depositLock+2, "expirationOf", multisigHash) - // `lockDepositUntil`: bad `till` (less then the previous one) + // `lockDepositUntil`: bad `till` (less than the previous one) notaryCommitteeInvoker.Invoke(t, false, "lockDepositUntil", multisigHash, int64(depositLock+1)) notaryCommitteeInvoker.Invoke(t, depositLock+2, "expirationOf", multisigHash) - // `lockDepositUntil`: bad `till` (less then the chain's height) + // `lockDepositUntil`: bad `till` (less than the chain's height) notaryCommitteeInvoker.Invoke(t, false, "lockDepositUntil", multisigHash, int64(1)) notaryCommitteeInvoker.Invoke(t, depositLock+2, "expirationOf", multisigHash) diff --git a/pkg/core/native/notary.go b/pkg/core/native/notary.go index 75224f2d0..c0b2da285 100644 --- a/pkg/core/native/notary.go +++ b/pkg/core/native/notary.go @@ -233,15 +233,15 @@ func (n *Notary) onPayment(ic *interop.Context, args []stackitem.Item) stackitem deposit := n.GetDepositFor(ic.DAO, to) till := toUint32(additionalParams[1]) if till < currentHeight+2 { - panic(fmt.Errorf("`till` shouldn't be less then the chain's height + 1 (%d at min)", currentHeight+2)) + panic(fmt.Errorf("`till` shouldn't be less than the chain's height + 1 (%d at min)", currentHeight+2)) } if deposit != nil && till < deposit.Till { - panic(fmt.Errorf("`till` shouldn't be less then the previous value %d", deposit.Till)) + panic(fmt.Errorf("`till` shouldn't be less than the previous value %d", deposit.Till)) } feePerKey := n.GetNotaryServiceFeePerKey(ic.DAO) if deposit == nil { if amount.Cmp(big.NewInt(2*feePerKey)) < 0 { - panic(fmt.Errorf("first deposit can not be less then %d, got %d", 2*feePerKey, amount.Int64())) + panic(fmt.Errorf("first deposit can not be less than %d, got %d", 2*feePerKey, amount.Int64())) } deposit = &state.Deposit{ Amount: new(big.Int), diff --git a/pkg/services/rpcsrv/server.go b/pkg/services/rpcsrv/server.go index d02588b7b..85e32069c 100644 --- a/pkg/services/rpcsrv/server.go +++ b/pkg/services/rpcsrv/server.go @@ -2998,7 +2998,7 @@ func (s *Server) blockHeightFromParam(param *params.Param) (uint32, *neorpc.Erro } if num < 0 || int64(num) > int64(s.chain.BlockHeight()) { - return 0, neorpc.WrapErrorWithData(neorpc.ErrUnknownHeight, fmt.Sprintf("param at index %d should be greater than or equal to 0 and less then or equal to current block height, got: %d", 0, num)) + return 0, neorpc.WrapErrorWithData(neorpc.ErrUnknownHeight, fmt.Sprintf("param at index %d should be greater than or equal to 0 and less than or equal to current block height, got: %d", 0, num)) } return uint32(num), nil }