Skip to content

Commit

Permalink
Merge pull request #1620 from statechannels/rearrange
Browse files Browse the repository at this point in the history
chore: rearrange type conversion files
  • Loading branch information
geoknee authored Aug 31, 2023
2 parents 6975df2 + 6f5e487 commit 4bc71e7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
21 changes: 0 additions & 21 deletions node/engine/chainservice/adjudicator/convert_signature.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package NitroAdjudicator

import "github.com/statechannels/go-nitro/channel/state/outcome"
import (
"github.com/statechannels/go-nitro/channel/state"
"github.com/statechannels/go-nitro/channel/state/outcome"
)

// ConvertBindingsExitToExit converts the exit type returned from abigen bindings to an outcome.Exit
func ConvertBindingsExitToExit(e []ExitFormatSingleAssetExit) outcome.Exit {
Expand Down Expand Up @@ -34,3 +37,21 @@ func convertBindingsAllocationsToAllocations(as []ExitFormatAllocation) outcome.
}
return allocations
}

// ConvertBindingsSignatureToSignature converts the signature type returned from abigien bindings to a state.Signature
func ConvertBindingsSignatureToSignature(s INitroTypesSignature) state.Signature {
return state.Signature{
R: s.R[:],
S: s.S[:],
V: s.V,
}
}

// ConvertBindingsSignatureToSignature converts a slice of the signature type returned from abigien bindings to a []state.Signature
func ConvertBindingsSignaturesToSignatures(ss []INitroTypesSignature) []state.Signature {
sigs := make([]state.Signature, 0, len(ss))
for _, s := range ss {
sigs = append(sigs, ConvertBindingsSignatureToSignature(s))
}
return sigs
}

0 comments on commit 4bc71e7

Please sign in to comment.