forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v0.47.7' into release/v0.47.x
Release v0.47.7
- Loading branch information
Showing
54 changed files
with
1,029 additions
and
523 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Cosmos SDK v0.47.5 Release Notes | ||
# Cosmos SDK v0.47.7 Release Notes | ||
|
||
💬 [**Release Discussion**](https://github.com/orgs/cosmos/discussions/categories/announcements) | ||
|
||
## 🚀 Highlights | ||
|
||
Get ready for v0.50.0 and start integrating with the next [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.0-rc.0) release. | ||
v0.50 is there, the v0.47.x line is now supported for bug fixes only, as per our release policy. | ||
Start integrating with [Cosmos SDK Eden (v0.50)](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.2) and enjoy and the new features and performance improvements. | ||
|
||
For this 5th patch release of the `v0.47.x` line, some of the notable changes include: | ||
For this 7th patch release of the `v0.47.x` line, some of the notable changes include: | ||
|
||
* A new command for importing private keys encoded in hex. This complements the existing `import` command that supports mnemonic and key files. | ||
Use `<appd> keys import <name> <hex>` to import a private key encoded in hex. | ||
* A new command, `rpc.QueryEventForTxCmd` for querying a transaction by its hash and blocking until the transaction is included in a block. It is useful as an alternative to the legacy `--sync block`. | ||
* A bug fix in the `app.toml` parsing for the `minimum-gas-prices` parameter. | ||
* A bug fix to properly simulate a transaction when using a multisig. | ||
|
||
Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.47.5/CHANGELOG.md) for an exhaustive list of changes or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/release/v0.47.4...v0.47.5) from last release. | ||
Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.47.5/CHANGELOG.md) for an exhaustive list of changes or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/v0.47.6...v0.47.7) from last release. | ||
|
||
Refer to the [upgrading guide](https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md) when migrating from `v0.46.x` to `v0.47.0`. | ||
Refer to the [upgrading guide](https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/UPGRADING.md) when migrating from `v0.47.x` to `v0.50.x`. |
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
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 |
---|---|---|
@@ -1,34 +1,120 @@ | ||
package tx_test | ||
package tx | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/client/tx" | ||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/crypto/hd" | ||
"github.com/cosmos/cosmos-sdk/crypto/keyring" | ||
"github.com/cosmos/cosmos-sdk/crypto/keys/multisig" | ||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" | ||
"github.com/cosmos/cosmos-sdk/crypto/types" | ||
"github.com/cosmos/cosmos-sdk/testutil/testdata" | ||
"github.com/cosmos/cosmos-sdk/types/tx/signing" | ||
|
||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" | ||
) | ||
|
||
func TestFactoryPrepate(t *testing.T) { | ||
func TestFactoryPrepare(t *testing.T) { | ||
t.Parallel() | ||
|
||
factory := tx.Factory{} | ||
factory := Factory{} | ||
clientCtx := client.Context{} | ||
|
||
output, err := factory.Prepare(clientCtx.WithOffline(true)) | ||
require.NoError(t, err) | ||
require.Equal(t, output, factory) | ||
|
||
factory = tx.Factory{}.WithAccountRetriever(client.MockAccountRetriever{ReturnAccNum: 10, ReturnAccSeq: 1}).WithAccountNumber(5) | ||
factory = Factory{}.WithAccountRetriever(client.MockAccountRetriever{ReturnAccNum: 10, ReturnAccSeq: 1}).WithAccountNumber(5) | ||
output, err = factory.Prepare(clientCtx.WithFrom("foo")) | ||
require.NoError(t, err) | ||
require.NotEqual(t, output, factory) | ||
require.Equal(t, output.AccountNumber(), uint64(5)) | ||
require.Equal(t, output.Sequence(), uint64(1)) | ||
|
||
factory = tx.Factory{}.WithAccountRetriever(client.MockAccountRetriever{ReturnAccNum: 10, ReturnAccSeq: 1}) | ||
factory = Factory{}.WithAccountRetriever(client.MockAccountRetriever{ReturnAccNum: 10, ReturnAccSeq: 1}) | ||
output, err = factory.Prepare(clientCtx.WithFrom("foo")) | ||
require.NoError(t, err) | ||
require.NotEqual(t, output, factory) | ||
require.Equal(t, output.AccountNumber(), uint64(10)) | ||
require.Equal(t, output.Sequence(), uint64(1)) | ||
} | ||
|
||
func TestFactory_getSimPKType(t *testing.T) { | ||
// setup keyring | ||
registry := codectypes.NewInterfaceRegistry() | ||
cryptocodec.RegisterInterfaces(registry) | ||
k := keyring.NewInMemory(codec.NewProtoCodec(registry)) | ||
|
||
tests := []struct { | ||
name string | ||
fromName string | ||
genKey func(fromName string, k keyring.Keyring) error | ||
wantType types.PubKey | ||
}{ | ||
{ | ||
name: "simple key", | ||
fromName: "testKey", | ||
genKey: func(fromName string, k keyring.Keyring) error { | ||
_, err := k.NewAccount(fromName, testdata.TestMnemonic, "", "", hd.Secp256k1) | ||
return err | ||
}, | ||
wantType: (*secp256k1.PubKey)(nil), | ||
}, | ||
{ | ||
name: "multisig key", | ||
fromName: "multiKey", | ||
genKey: func(fromName string, k keyring.Keyring) error { | ||
pk := multisig.NewLegacyAminoPubKey(1, []types.PubKey{&multisig.LegacyAminoPubKey{}}) | ||
_, err := k.SaveMultisig(fromName, pk) | ||
return err | ||
}, | ||
wantType: (*multisig.LegacyAminoPubKey)(nil), | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
err := tt.genKey(tt.fromName, k) | ||
require.NoError(t, err) | ||
f := Factory{ | ||
keybase: k, | ||
fromName: tt.fromName, | ||
simulateAndExecute: true, | ||
} | ||
got, err := f.getSimPK() | ||
require.NoError(t, err) | ||
require.IsType(t, tt.wantType, got) | ||
}) | ||
} | ||
} | ||
|
||
func TestFactory_getSimSignatureData(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
pk types.PubKey | ||
wantType any | ||
}{ | ||
{ | ||
name: "simple pubkey", | ||
pk: &secp256k1.PubKey{}, | ||
wantType: (*signing.SingleSignatureData)(nil), | ||
}, | ||
{ | ||
name: "multisig pubkey", | ||
pk: &multisig.LegacyAminoPubKey{}, | ||
wantType: (*signing.MultiSignatureData)(nil), | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
got := Factory{}.getSimSignatureData(tt.pk) | ||
require.IsType(t, tt.wantType, got) | ||
}) | ||
} | ||
} |
Oops, something went wrong.