Skip to content

Commit

Permalink
Refactor: addressed linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Oct 3, 2023
1 parent f0c45ae commit 4fa5e49
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions components/inx/server_issuance.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@ func (s *Server) ValidatePayload(_ context.Context, payload *inx.RawPayload) (*i

loadedInputs := make([]mempool.State, 0)
for _, inputReference := range inputReferences {
if metadata, metadataErr := memPool.StateMetadata(inputReference); metadataErr != nil {
metadata, metadataErr := memPool.StateMetadata(inputReference)
if metadataErr != nil {
return metadataErr
} else {
loadedInputs = append(loadedInputs, metadata.State())
}

loadedInputs = append(loadedInputs, metadata.State())
}

if executionContext, validationErr := memPool.VM().ValidateSignatures(typedPayload, loadedInputs); validationErr != nil {
executionContext, validationErr := memPool.VM().ValidateSignatures(typedPayload, loadedInputs)
if validationErr != nil {
return validationErr
} else {
return lo.Return2(memPool.VM().Execute(executionContext, typedPayload.Transaction))
}

return lo.Return2(memPool.VM().Execute(executionContext, typedPayload.Transaction))

case *iotago.TaggedData:
// TaggedData is always valid if serix decoding was successful
return nil
Expand Down

0 comments on commit 4fa5e49

Please sign in to comment.