Skip to content

Commit

Permalink
export ExitTy exit type for abi encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
geoknee authored and andrewgordstewart committed Jan 10, 2022
1 parent ed5f39b commit 7412bc6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions channel/state/outcome/exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func (e Exit) TotalAllocatedFor(dest types.Destination) types.Funds {
return total
}

// exitTy describes the shape of Exit such that github.com/ethereum/go-ethereum/accounts/abi can parse it
var exitTy, _ = abi.NewType("tuple[]", "struct ExitFormat.SingleAssetExit[]", []abi.ArgumentMarshaling{
// ExitTy describes the shape of Exit such that github.com/ethereum/go-ethereum/accounts/abi can parse it
var ExitTy, _ = abi.NewType("tuple[]", "struct ExitFormat.SingleAssetExit[]", []abi.ArgumentMarshaling{
{Name: "asset", Type: "address"},
{Name: "metadata", Type: "bytes"},
allocationsTy,
Expand Down Expand Up @@ -131,12 +131,12 @@ func convertToExit(r rawExitType) Exit {

// Encode returns the abi encoded Exit
func (e *Exit) Encode() (types.Bytes, error) {
return abi.Arguments{{Type: exitTy}}.Pack(e)
return abi.Arguments{{Type: ExitTy}}.Pack(e)
}

// Decode returns an Exit from an abi encoding
func Decode(data types.Bytes) (Exit, error) {
unpacked, err := abi.Arguments{{Type: exitTy}}.Unpack(data)
unpacked, err := abi.Arguments{{Type: ExitTy}}.Unpack(data)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7412bc6

Please sign in to comment.