Skip to content

Commit

Permalink
Fix typo in predictable.
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierlepretre committed Aug 12, 2024
1 parent f8f6fe2 commit 928aee0
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/proto/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmwasm/wasm/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions x/wasm/keeper/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/contract_keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (p PermissionedKeeper) Instantiate2(
initMsg,
label,
deposit,
PredicableAddressGenerator(creator, salt, initMsg, fixMsg),
PredictableAddressGenerator(creator, salt, initMsg, fixMsg),
p.authZPolicy,
)
}
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion x/wasm/types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 928aee0

Please sign in to comment.