feat: x/auth determinism tests for Account query (#13255)
* WIP: rapid tests * remove commented code * review changes * review changes * review changes * review changes * review changes * review changes * review changes * review changes * review changes * review changes * `go mod tidy`
This commit is contained in:
Vendored
+9
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"
|
||||
@@ -12,6 +13,14 @@ import (
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
)
|
||||
|
||||
// AddressGenerator creates and returns a random address generator using rapid.
|
||||
func AddressGenerator(t *rapid.T) *rapid.Generator[sdk.AccAddress] {
|
||||
return rapid.Custom(func(t *rapid.T) sdk.AccAddress {
|
||||
pkBz := rapid.SliceOfN(rapid.Byte(), 20, 20).Draw(t, "hex")
|
||||
return sdk.AccAddress(pkBz)
|
||||
})
|
||||
}
|
||||
|
||||
// KeyTestPubAddr generates a new secp256k1 keypair.
|
||||
func KeyTestPubAddr() (cryptotypes.PrivKey, cryptotypes.PubKey, sdk.AccAddress) {
|
||||
key := secp256k1.GenPrivKey()
|
||||
|
||||
Reference in New Issue
Block a user