From 403e978375f8324351b6f13455beb485eca13244 Mon Sep 17 00:00:00 2001 From: freehere107 Date: Wed, 6 Nov 2024 18:17:39 +0800 Subject: [PATCH] Fix extrinsic tip before metadata v14 --- extrinsic.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extrinsic.go b/extrinsic.go index 14f4353..63ef151 100644 --- a/extrinsic.go +++ b/extrinsic.go @@ -142,7 +142,11 @@ func (e *ExtrinsicDecoder) Process() { } e.Era = e.ProcessAndUpdateData("EraExtrinsic").(string) e.Nonce = int(e.ProcessAndUpdateData("Compact").(uint64)) - if e.Metadata.Extrinsic == nil { + if e.Metadata.Extrinsic != nil { + if e.Metadata.MetadataVersion < 14 && utiles.SliceIndex("ChargeTransactionPayment", e.Metadata.Extrinsic.SignedIdentifier) != -1 { + result.Tip = utiles.DecimalFromInterface(e.ProcessAndUpdateData("Compact")) + } + } else { result.Tip = utiles.DecimalFromInterface(e.ProcessAndUpdateData("Compact")) } // spec SignedExtensions