Skip to content

Commit

Permalink
Fix extrinsic tip before metadata v14
Browse files Browse the repository at this point in the history
  • Loading branch information
freehere107 committed Nov 6, 2024
1 parent f03eae1 commit 403e978
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion extrinsic.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ func (e *ExtrinsicDecoder) Process() {
}
e.Era = e.ProcessAndUpdateData("EraExtrinsic").(string)
e.Nonce = int(e.ProcessAndUpdateData("Compact<U64>").(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<Balance>"))
}
} else {
result.Tip = utiles.DecimalFromInterface(e.ProcessAndUpdateData("Compact<Balance>"))
}
// spec SignedExtensions
Expand Down

0 comments on commit 403e978

Please sign in to comment.