From 91238f3833f126c8720277380b2ccf0ed650357f Mon Sep 17 00:00:00 2001 From: Cosmin Damian <17934949+cdamian@users.noreply.github.com> Date: Wed, 19 Oct 2022 23:32:37 +0200 Subject: [PATCH] types: Remove FailedToTransactAsset field from XCM Error (#305) --- types/event_record.go | 2 -- types/xcm_error.go | 9 +-------- types/xcm_error_test.go | 2 -- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/types/event_record.go b/types/event_record.go index b21deedfc..77f3b2c53 100644 --- a/types/event_record.go +++ b/types/event_record.go @@ -517,8 +517,6 @@ func (e EventRecordsRaw) DecodeEventRecords(m *Metadata, t interface{}) error { return fmt.Errorf("unable to find event with EventID %v in metadata for event #%v: %s", id, i, err) } - // fmt.Printf("event #%v is in module %v with event name %v\n", i, moduleName, eventName) - log.Debug(fmt.Sprintf("event #%v is in module %v with event name %v", i, moduleName, eventName)) // check whether name for eventID exists in t diff --git a/types/xcm_error.go b/types/xcm_error.go index 1ff78a729..8c7ad3e50 100644 --- a/types/xcm_error.go +++ b/types/xcm_error.go @@ -38,7 +38,6 @@ type XCMError struct { IsAssetNotFound bool IsFailedToTransactAsset bool - FailedToTransactAsset string IsNotWithdrawable bool @@ -103,8 +102,6 @@ func (x *XCMError) Decode(decoder scale.Decoder) error { //nolint: funlen x.IsAssetNotFound = true case 9: x.IsFailedToTransactAsset = true - - return decoder.Decode(&x.FailedToTransactAsset) case 10: x.IsNotWithdrawable = true case 11: @@ -169,11 +166,7 @@ func (x XCMError) Encode(encoder scale.Encoder) error { //nolint:gocyclo,funlen case x.IsAssetNotFound: return encoder.PushByte(8) case x.IsFailedToTransactAsset: - if err := encoder.PushByte(9); err != nil { - return err - } - - return encoder.Encode(x.FailedToTransactAsset) + return encoder.PushByte(9) case x.IsNotWithdrawable: return encoder.PushByte(10) case x.IsLocationCannotHold: diff --git a/types/xcm_error_test.go b/types/xcm_error_test.go index a6132dc58..da6b14354 100644 --- a/types/xcm_error_test.go +++ b/types/xcm_error_test.go @@ -48,8 +48,6 @@ var ( x.IsAssetNotFound = true case 9: x.IsFailedToTransactAsset = true - - c.Fuzz(&x.FailedToTransactAsset) case 10: x.IsNotWithdrawable = true case 11: