Skip to content

Commit

Permalink
Merge 73425a5 into bf2a606
Browse files Browse the repository at this point in the history
  • Loading branch information
Liuhaai committed Jan 18, 2023
2 parents bf2a606 + 73425a5 commit 12650b4
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions action/protocol/account/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ import (
const TransferSizeLimit = 32 * 1024

// handleTransfer handles a transfer
func (p *Protocol) handleTransfer(ctx context.Context, act action.Action, sm protocol.StateManager) (*action.Receipt, error) {
tsf, ok := act.(*action.Transfer)
if !ok {
return nil, nil
}
func (p *Protocol) handleTransfer(ctx context.Context, tsf *action.Transfer, sm protocol.StateManager) (*action.Receipt, error) {
var (
fCtx = protocol.MustGetFeatureCtx(ctx)
actionCtx = protocol.MustGetActionCtx(ctx)
Expand Down Expand Up @@ -162,11 +158,7 @@ func (p *Protocol) handleTransfer(ctx context.Context, act action.Action, sm pro
}

// validateTransfer validates a transfer
func (p *Protocol) validateTransfer(ctx context.Context, act action.Action) error {
tsf, ok := act.(*action.Transfer)
if !ok {
return nil
}
func (p *Protocol) validateTransfer(ctx context.Context, tsf *action.Transfer) error {
// Reject oversized transfer
if tsf.TotalSize() > TransferSizeLimit {
return action.ErrOversizedData
Expand Down

0 comments on commit 12650b4

Please sign in to comment.