File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
3838
3939## [ Unreleased]
4040
41+ ### Bug Fixes
42+
43+ * [ #19106 ] ( https://github.com/cosmos/cosmos-sdk/pull/19106 ) Allow empty public keys when setting signatures. Public keys aren't needed for every transaction.
44+
4145## [ v0.50.3] ( https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.3 ) - 2023-01-15
4246
4347### Features
Original file line number Diff line number Diff line change @@ -340,11 +340,17 @@ func (w *wrapper) SetSignatures(signatures ...signing.SignatureV2) error {
340340 rawSigs := make ([][]byte , n )
341341
342342 for i , sig := range signatures {
343- var modeInfo * tx.ModeInfo
343+ var (
344+ modeInfo * tx.ModeInfo
345+ pubKey * codectypes.Any
346+ err error
347+ )
344348 modeInfo , rawSigs [i ] = SignatureDataToModeInfoAndSig (sig .Data )
345- pubKey , err := codectypes .NewAnyWithValue (sig .PubKey )
346- if err != nil {
347- return err
349+ if sig .PubKey != nil {
350+ pubKey , err = codectypes .NewAnyWithValue (sig .PubKey )
351+ if err != nil {
352+ return err
353+ }
348354 }
349355 signerInfos [i ] = & tx.SignerInfo {
350356 PublicKey : pubKey ,
Original file line number Diff line number Diff line change @@ -127,6 +127,20 @@ func TestTxBuilder(t *testing.T) {
127127 })
128128}
129129
130+ func TestSetSignaturesNoPublicKey (t * testing.T ) {
131+ _ , pubkey , _ := testdata .KeyTestPubAddr ()
132+ txBuilder := newBuilder (nil )
133+ sig2 := signing.SignatureV2 {
134+ Data : & signing.SingleSignatureData {
135+ SignMode : signing .SignMode_SIGN_MODE_DIRECT ,
136+ Signature : legacy .Cdc .MustMarshal (pubkey ),
137+ },
138+ Sequence : 1 ,
139+ }
140+ err := txBuilder .SetSignatures (sig2 )
141+ require .NoError (t , err )
142+ }
143+
130144func TestBuilderValidateBasic (t * testing.T ) {
131145 // keys and addresses
132146 _ , pubKey1 , addr1 := testdata .KeyTestPubAddr ()
You can’t perform that action at this time.
0 commit comments