Skip to content

Commit

Permalink
chore: fix some comments (#1591)
Browse files Browse the repository at this point in the history
Signed-off-by: chuangjinglu <chuangjinglu@outlook.com>
Co-authored-by: Alexey Kiselev <alexey.kiselev@gmail.com>
  • Loading branch information
chuangjinglu and alexeykiselev authored Jan 27, 2025
1 parent da09fa1 commit c8a14a7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pkg/consensus/blocks_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (cv *Validator) validateMinerAccount(block *proto.BlockHeader, blockHeight
}
minerAddr, err := proto.NewAddressFromPublicKey(cv.settings.AddressSchemeCharacter, block.GeneratorPublicKey)
if err != nil {
return errors.Wrapf(err, "faield to get miner address from pub key %q", block.GeneratorPublicKey.String())
return errors.Wrapf(err, "failed to get miner address from pub key %q", block.GeneratorPublicKey.String())
}
blockMinerHasScript, err := cv.state.NewestAccountHasScript(minerAddr)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/proto/ethabi/methods_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func newMethodsMapFromRideDAppMeta(dApp meta.DApp, parsePayments bool) (MethodsM
continue // ignore ride callable with unsupported argument type
}
return MethodsMap{}, errors.Wrapf(err,
"failed to build ABI db from DApp metadata, verison %d", dApp.Version,
"failed to build ABI db from DApp metadata, version %d", dApp.Version,
)
}
methods[method.Sig.Selector()] = method
Expand Down
2 changes: 1 addition & 1 deletion pkg/proto/ethabi/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func tryAsInt64(dataT DataType) (int64, error) {
}
}

// forEachUnpack iteratively unpack elements.
// forEachUnpackRideList iteratively unpack elements.
func forEachUnpackRideList(t Type, output []byte, start, size int) (_ List, slotsReadTotal int, err error) {
if t.T != SliceType { // here we can only handle slice type
return nil, 0, errors.Errorf("abi: invalid type in slice unpacking stage")
Expand Down
2 changes: 1 addition & 1 deletion pkg/state/rewards_calculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (c *rewardCalculator) performCalculation(
}
// sanity check
if cnt := len(rewardAddresses); cnt > additionalAddressesCount {
panic(fmt.Sprintf("reward addresses count=%d is greater than additional addreses count which is %d",
panic(fmt.Sprintf("reward addresses count=%d is greater than additional addresses count which is %d",
cnt, additionalAddressesCount,
))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/state/snapshot_hasher_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func BenchmarkTxSnapshotHasher(b *testing.B) {
for j := 0; j < b.N; j++ {
h, hErr := calculateTxSnapshotStateHash(hasher, txID, blockHeight, prevHash, txSnapshot)
if hErr != nil {
b.Fatalf("error occured: %+v", err)
b.Fatalf("error occurred: %+v", err)
}
if h != expectedHash {
b.Fatalf("expectedHash=%s != actual=%s", expectedHash.Hex(), h.Hex())
Expand Down
2 changes: 1 addition & 1 deletion pkg/state/transaction_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1453,7 +1453,7 @@ func (tc *transactionChecker) tryCreateDAppEstimationUpdate(
}
treeEstimation, err := ride.EstimateTree(tree, currentEstimatorVersion)
if err != nil {
return scriptEstimation{}, false, errors.Wrapf(err, "faield to estimate script by addr %q", scriptAddr)
return scriptEstimation{}, false, errors.Wrapf(err, "failed to estimate script by addr %q", scriptAddr)
}
return scriptEstimation{
currentEstimatorVersion: currentEstimatorVersion,
Expand Down

0 comments on commit c8a14a7

Please sign in to comment.