diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index 9dafeb1ec..c21dc10e1 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 adbc96ad6..88a06f7a5 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 9ca62cf2b..d1b595d26 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 4f7093631..245377f17 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 3faf459bd..eceef1eac 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 691ffa445..3616c8cf3 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 32d0b3d1d..f0c58e7e1 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"`