hyperledger-labs / go-perun

🌔 Perun's Blockchain-Agnostic State Channels Framework in Go.
https://perun.network/
Apache License 2.0
55 stars 18 forks source link

JSON Marshaling of channel.State and Params #330

Closed sebastianst closed 2 years ago

sebastianst commented 2 years ago

For now, only States and Params without App and Data are supported.

While using any particular backend, the implementations of Asset and Address must be JSON marshalable.

sebastianst commented 2 years ago

@cryptphil The App can actually be encoded. In perunio encoding, we do it using the AppDef() wallet.Address as wire value and then channel.Resolve to resolve the Address back into an App. But I spoke to @matthiasgeihs last week about this PR and we're probably not gonna merge it anyways and I'll instead use this json implementation in the perun-fabric repository, where I don't need apps. So I won't spend time implementing this last bit unless we decide to put it into go-perun.

cryptphil commented 2 years ago

@cryptphil The App can actually be encoded. In perunio encoding, we do it using the AppDef() wallet.Address as wire value and then channel.Resolve to resolve the Address back into an App. But I spoke to @matthiasgeihs last week about this PR and we're probably not gonna merge it anyways and I'll instead use this json implementation in the perun-fabric repository, where I don't need apps. So I won't spend time implementing this last bit unless we decide to put it into go-perun.

Oh okay, I understand. Still, good to know that it would even be possible to (un)marshal the remaining fields App and thus also Data.

sebastianst commented 2 years ago

As we discussed, will implement JSON marshaling directly in perun-fabric. So closing this PR as obsolete.