-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(x/auth): allow empty public keys for GetSignBytesAdapter (ba…
…ckport #19651) (#19675) Co-authored-by: mmsqe <mavis@crypto.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
- Loading branch information
1 parent
2abd2ec
commit f9041cd
Showing
3 changed files
with
49 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package signing_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/cosmos/cosmos-sdk/testutil/testdata" | ||
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" | ||
"github.com/cosmos/cosmos-sdk/types/tx/signing" | ||
authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" | ||
) | ||
|
||
func TestGetSignBytesAdapterNoPublicKey(t *testing.T) { | ||
encodingConfig := moduletestutil.MakeTestEncodingConfig() | ||
txConfig := encodingConfig.TxConfig | ||
_, _, addr := testdata.KeyTestPubAddr() | ||
signerData := authsign.SignerData{ | ||
Address: addr.String(), | ||
ChainID: "test-chain", | ||
AccountNumber: 11, | ||
Sequence: 15, | ||
} | ||
w := txConfig.NewTxBuilder() | ||
_, err := authsign.GetSignBytesAdapter( | ||
context.Background(), | ||
txConfig.SignModeHandler(), | ||
signing.SignMode_SIGN_MODE_DIRECT, | ||
signerData, | ||
w.GetTx()) | ||
require.NoError(t, err) | ||
} |