From eac360c178973436b3f7115121823352e4dae496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Lepr=C3=AAtre?= Date: Mon, 12 Aug 2024 18:08:59 +0400 Subject: [PATCH] Fix typo in predictable. (#1957) --- docs/proto/proto-docs.md | 2 +- proto/cosmwasm/wasm/v1/tx.proto | 2 +- x/wasm/client/cli/tx.go | 2 +- x/wasm/keeper/addresses.go | 4 ++-- x/wasm/keeper/contract_keeper.go | 2 +- x/wasm/keeper/msg_server.go | 2 +- x/wasm/types/tx.pb.go | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 9dafeb1ec7..c21dc10e19 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -1536,7 +1536,7 @@ code id. ### MsgInstantiateContract2 MsgInstantiateContract2 create a new smart contract instance for the given -code id with a predicable address. +code id with a predictable address. | Field | Type | Label | Description | diff --git a/proto/cosmwasm/wasm/v1/tx.proto b/proto/cosmwasm/wasm/v1/tx.proto index adbc96ad6d..88a06f7a5a 100644 --- a/proto/cosmwasm/wasm/v1/tx.proto +++ b/proto/cosmwasm/wasm/v1/tx.proto @@ -145,7 +145,7 @@ message MsgInstantiateContractResponse { } // MsgInstantiateContract2 create a new smart contract instance for the given -// code id with a predicable address. +// code id with a predictable address. message MsgInstantiateContract2 { option (amino.name) = "wasm/MsgInstantiateContract2"; option (cosmos.msg.v1.signer) = "sender"; diff --git a/x/wasm/client/cli/tx.go b/x/wasm/client/cli/tx.go index 9ca62cf2b7..d1b595d269 100644 --- a/x/wasm/client/cli/tx.go +++ b/x/wasm/client/cli/tx.go @@ -228,7 +228,7 @@ $ %s tx wasm instantiate 1 '{"foo":"bar"}' --admin="$(%s keys show mykey -a)" \ return cmd } -// InstantiateContract2Cmd will instantiate a contract from previously uploaded code with predicable address generated +// InstantiateContract2Cmd will instantiate a contract from previously uploaded code with predictable address generated func InstantiateContract2Cmd() *cobra.Command { decoder := newArgDecoder(hex.DecodeString) cmd := &cobra.Command{ diff --git a/x/wasm/keeper/addresses.go b/x/wasm/keeper/addresses.go index 4f7093631d..245377f173 100644 --- a/x/wasm/keeper/addresses.go +++ b/x/wasm/keeper/addresses.go @@ -22,8 +22,8 @@ func (k Keeper) ClassicAddressGenerator() AddressGenerator { } } -// PredicableAddressGenerator generates a predictable contract address -func PredicableAddressGenerator(creator sdk.AccAddress, salt, msg []byte, fixMsg bool) AddressGenerator { +// PredictableAddressGenerator generates a predictable contract address +func PredictableAddressGenerator(creator sdk.AccAddress, salt, msg []byte, fixMsg bool) AddressGenerator { return func(_ context.Context, _ uint64, checksum []byte) sdk.AccAddress { if !fixMsg { // clear msg to not be included in the address generation msg = []byte{} diff --git a/x/wasm/keeper/contract_keeper.go b/x/wasm/keeper/contract_keeper.go index 3faf459bdf..eceef1eacf 100644 --- a/x/wasm/keeper/contract_keeper.go +++ b/x/wasm/keeper/contract_keeper.go @@ -88,7 +88,7 @@ func (p PermissionedKeeper) Instantiate2( initMsg, label, deposit, - PredicableAddressGenerator(creator, salt, initMsg, fixMsg), + PredictableAddressGenerator(creator, salt, initMsg, fixMsg), p.authZPolicy, ) } diff --git a/x/wasm/keeper/msg_server.go b/x/wasm/keeper/msg_server.go index 691ffa445c..3616c8cf39 100644 --- a/x/wasm/keeper/msg_server.go +++ b/x/wasm/keeper/msg_server.go @@ -94,7 +94,7 @@ func (m msgServer) InstantiateContract2(ctx context.Context, msg *types.MsgInsta policy := m.selectAuthorizationPolicy(ctx, msg.Sender) - addrGenerator := PredicableAddressGenerator(senderAddr, msg.Salt, msg.Msg, msg.FixMsg) + addrGenerator := PredictableAddressGenerator(senderAddr, msg.Salt, msg.Msg, msg.FixMsg) contractAddr, data, err := m.keeper.instantiate(ctx, msg.CodeID, senderAddr, adminAddr, msg.Msg, msg.Label, msg.Funds, addrGenerator, policy) if err != nil { diff --git a/x/wasm/types/tx.pb.go b/x/wasm/types/tx.pb.go index 32d0b3d1d2..f0c58e7e1f 100644 --- a/x/wasm/types/tx.pb.go +++ b/x/wasm/types/tx.pb.go @@ -233,7 +233,7 @@ func (m *MsgInstantiateContractResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInstantiateContractResponse proto.InternalMessageInfo // MsgInstantiateContract2 create a new smart contract instance for the given -// code id with a predicable address. +// code id with a predictable address. type MsgInstantiateContract2 struct { // Sender is the that actor that signed the messages Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`