Skip to content

Commit

Permalink
GenericExtrinsic encode support SignedExtensions
Browse files Browse the repository at this point in the history
  • Loading branch information
freehere107 committed Jul 27, 2023
1 parent 39a1681 commit 5583807
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions extrinsic.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ func (g *GenericExtrinsic) Encode(opt *scaleType.ScaleDecoderOption) (string, er
data = data + scaleType.Encode("EraExtrinsic", g.Era) // era
data = data + scaleType.Encode("Compact<U64>", g.Nonce) // nonce
data = data + scaleType.Encode("Compact<Balance>", g.Tip) // tip
for identifier, extension := range g.SignedExtensions {
for _, ext := range opt.Metadata.Extrinsic.SignedExtensions {
if ext.Identifier == identifier {
data = data + scaleType.Encode(ext.TypeString, extension)
}
}
}
}

data = data + g.CallCode
Expand Down

0 comments on commit 5583807

Please sign in to comment.