From 25d5f9d1da347e9218e27b4774eec379048b09ad Mon Sep 17 00:00:00 2001 From: Erwan Renaut <73958772+renauter@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:14:37 -0300 Subject: [PATCH] fix(clients): propagate Cause enum new entry --- clients/tfchain-client-go/contract.go | 9 +++++++-- clients/tfchain-client-js/types.json | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/clients/tfchain-client-go/contract.go b/clients/tfchain-client-go/contract.go index f6f966d13..45296b93a 100644 --- a/clients/tfchain-client-go/contract.go +++ b/clients/tfchain-client-go/contract.go @@ -9,8 +9,9 @@ import ( ) type DeletedState struct { - IsCanceledByUser bool `json:"is_canceled_by_user"` - IsOutOfFunds bool `json:"is_out_of_funds"` + IsCanceledByUser bool `json:"is_canceled_by_user"` + IsOutOfFunds bool `json:"is_out_of_funds"` + IsCanceledByCollective bool `json:"is_canceled_by_collective"` } // Decode implementation for the enum type @@ -25,6 +26,8 @@ func (r *DeletedState) Decode(decoder scale.Decoder) error { r.IsCanceledByUser = true case 1: r.IsOutOfFunds = true + case 2: + r.IsCanceledByCollective = true default: return fmt.Errorf("unknown deleted state value") } @@ -38,6 +41,8 @@ func (r DeletedState) Encode(encoder scale.Encoder) (err error) { err = encoder.PushByte(0) } else if r.IsOutOfFunds { err = encoder.PushByte(1) + } else if r.IsCanceledByCollective { + err = encoder.PushByte(2) } return } diff --git a/clients/tfchain-client-js/types.json b/clients/tfchain-client-js/types.json index ce15a1412..11461013e 100644 --- a/clients/tfchain-client-js/types.json +++ b/clients/tfchain-client-js/types.json @@ -168,7 +168,8 @@ "Cause": { "_enum": [ "CanceledByUser", - "OutOfFunds" + "OutOfFunds", + "CanceledByCollective" ] }, "NruConsumption": { @@ -334,4 +335,4 @@ "farm_id": "u32", "weight": "u64" } -} +} \ No newline at end of file