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 api/grpcserver_integrity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var (
big.NewInt(testutil.TestGasPriceInt64))
_testTransferInvalid6Pb = _testTransferInvalid6.Proto()

// negative transfer amout
// negative transfer amount
_testTransferInvalid7, _ = action.SignedTransfer(identityset.Address(28).String(),
identityset.PrivateKey(28), 3, big.NewInt(-10), []byte{}, 10000,
big.NewInt(testutil.TestGasPriceInt64))
Expand Down Expand Up @@ -2634,7 +2634,7 @@ func TestGrpcServer_TraceTransactionStructLogsIntegrity(t *testing.T) {
_, err = grpcHandler.TraceTransactionStructLogs(context.Background(), request)
require.Error(err)

//unsupport type
// unsupported type
request.ActionHash = hex.EncodeToString(_transferHash1[:])
_, err = grpcHandler.TraceTransactionStructLogs(context.Background(), request)
require.Error(err)
Expand Down
8 changes: 4 additions & 4 deletions pkg/lifecycle/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (lc *Lifecycle) Add(m Model) { lc.models = append(lc.models, m) }
// AddModels adds multiple models into LifeCycle.
func (lc *Lifecycle) AddModels(m ...Model) { lc.models = append(lc.models, m...) }

// OnStart runs models OnStart function if models implmented it. All OnStart functions will be run in parallel.
// OnStart runs models OnStart function if models implemented it. All OnStart functions will be run in parallel.
// context passed into models' OnStart method will be canceled on the first time a model's OnStart function return non-nil error.
func (lc *Lifecycle) OnStart(ctx context.Context) error {
g, ctx := errgroup.WithContext(ctx)
Expand All @@ -58,7 +58,7 @@ func (lc *Lifecycle) OnStart(ctx context.Context) error {
return g.Wait()
}

// OnStop runs models Stop function if models implmented it. All OnStop functions will be run in parallel.
// OnStop runs models Stop function if models implemented it. All OnStop functions will be run in parallel.
// context passed into models' OnStop method will be canceled on the first time a model's OnStop function return non-nil error.
func (lc *Lifecycle) OnStop(ctx context.Context) error {
g, ctx := errgroup.WithContext(ctx)
Expand All @@ -70,7 +70,7 @@ func (lc *Lifecycle) OnStop(ctx context.Context) error {
return g.Wait()
}

// OnStartSequentially runs models' Start function if models implmented it.
// OnStartSequentially runs models' Start function if models implemented it.
func (lc *Lifecycle) OnStartSequentially(ctx context.Context) error {
for _, m := range lc.models {
if starter, ok := m.(Starter); ok {
Expand All @@ -82,7 +82,7 @@ func (lc *Lifecycle) OnStartSequentially(ctx context.Context) error {
return nil
}

// OnStopSequentially runs models' Stop function if models implmented it.
// OnStopSequentially runs models' Stop function if models implemented it.
func (lc *Lifecycle) OnStopSequentially(ctx context.Context) error {
for i := len(lc.models) - 1; i >= 0; i-- {
if stopper, ok := lc.models[i].(Stopper); ok {
Expand Down
2 changes: 1 addition & 1 deletion pkg/recovery/recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type (
// _crashlogDir saves the directory of crashlog
var _crashlogDir string = "/"

// Recover catchs the crashing goroutine
// Recover catches the crashing goroutine
func Recover() {
if r := recover(); r != nil {
LogCrash(r)
Expand Down