Verified Commit 5b410693 authored by Vincent Botbol's avatar Vincent Botbol Committed by Marco Stronati

Alpha/RPCs: fix wrong encoding name fields

This patch fixes a mislabeled field in the JSON encoding of operation receipts.
The balance updates had a field `level` that actually contained a cycle.
It is now named `cycle`.

Third party software that make use of receipts such as block explorers
or wallets may need to be updated accordingly. A simple solution is to
support both during the protocol change period.
parent a3d04dd2
......@@ -46,7 +46,7 @@ let balance_encoding =
(req "kind" (constant "freezer"))
(req "category" (constant "rewards"))
(req "delegate" Signature.Public_key_hash.encoding)
(req "level" Cycle_repr.encoding))
(req "cycle" Cycle_repr.encoding))
(function Rewards (d, l) -> Some ((), (), d, l) | _ -> None)
(fun ((), (), d, l) -> Rewards (d, l)) ;
case (Tag 2)
......@@ -55,7 +55,7 @@ let balance_encoding =
(req "kind" (constant "freezer"))
(req "category" (constant "fees"))
(req "delegate" Signature.Public_key_hash.encoding)
(req "level" Cycle_repr.encoding))
(req "cycle" Cycle_repr.encoding))
(function Fees (d, l) -> Some ((), (), d, l) | _ -> None)
(fun ((), (), d, l) -> Fees (d, l)) ;
case (Tag 3)
......@@ -64,7 +64,7 @@ let balance_encoding =
(req "kind" (constant "freezer"))
(req "category" (constant "deposits"))
(req "delegate" Signature.Public_key_hash.encoding)
(req "level" Cycle_repr.encoding))
(req "cycle" Cycle_repr.encoding))
(function Deposits (d, l) -> Some ((), (), d, l) | _ -> None)
(fun ((), (), d, l) -> Deposits (d, l)) ]
......@@ -624,4 +624,3 @@ let delegated_balance ctxt delegate =
let fold = Storage.Delegates.fold
let list = Storage.Delegates.elements
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment