Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit aa319dc

Browse files
committed
Correctly encode sc close txns
1 parent 4954060 commit aa319dc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/blockchain_api/schema/state_channel_close.ex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ defmodule BlockchainAPI.Schema.StateChannel do
22
use Ecto.Schema
33
import Ecto.Changeset
44

5-
@derive Jason.Encoder
5+
@fields [:id, :owner, :credits, :nonce, :balances, :root_hash, :state, :expire_at_block]
6+
7+
@derive {Jason.Encoder, only: @fields}
68
@primary_key false
79
embedded_schema do
810
field :id, :string, null: false
@@ -27,7 +29,9 @@ defmodule BlockchainAPI.Schema.StateChannel.Balance do
2729
use Ecto.Schema
2830
import Ecto.Changeset
2931

30-
@derive Jason.Encoder
32+
@fields [:hotspot, :num_bytes]
33+
34+
@derive {Jason.Encoder, only: @fields}
3135
@primary_key false
3236
schema "balances" do
3337
field :hotspot, :string

0 commit comments

Comments
 (0)