Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/api/node_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/miner/micro_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/proto/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/proto/eth_typed_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/proto/ethabi/function_signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pkg/ride/compiler/stdlib/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
4 changes: 2 additions & 2 deletions pkg/ride/functions_strings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions pkg/ride/tree_evaluation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Expand All @@ -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)
})
Expand Down