mirror of https://github.com/certusone/wasmd.git
Update go-cosmwasm to v0.11.0-alpha2, contracts to v0.11.0-alpha4
This commit is contained in:
parent
8db7c5f5cd
commit
9fb15beb42
2
go.mod
2
go.mod
|
@ -3,7 +3,7 @@ module github.com/CosmWasm/wasmd
|
|||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/CosmWasm/go-cosmwasm v0.11.0-alpha1
|
||||
github.com/CosmWasm/go-cosmwasm v0.11.0-alpha2
|
||||
github.com/cosmos/cosmos-sdk v0.39.1-0.20200727135228-9d00f712e334
|
||||
github.com/golang/mock v1.4.3 // indirect
|
||||
github.com/google/gofuzz v1.0.0
|
||||
|
|
2
go.sum
2
go.sum
|
@ -13,6 +13,8 @@ github.com/CosmWasm/go-cosmwasm v0.10.0 h1:3DBOiGtLllevLgf8PQO5+hRCKKqYEQJIw6cga
|
|||
github.com/CosmWasm/go-cosmwasm v0.10.0/go.mod h1:gAFCwllx97ejI+m9SqJQrmd2SBW7HA0fOjvWWJjM2uc=
|
||||
github.com/CosmWasm/go-cosmwasm v0.11.0-alpha1 h1:5c87JcnA+ncQlSJO/mEK6z9oIi/oS46CCsYduvRgPvw=
|
||||
github.com/CosmWasm/go-cosmwasm v0.11.0-alpha1/go.mod h1:gAFCwllx97ejI+m9SqJQrmd2SBW7HA0fOjvWWJjM2uc=
|
||||
github.com/CosmWasm/go-cosmwasm v0.11.0-alpha2 h1:w42GtYC4P/6dXOVlqEutr96tSsy/EO0aC9d3sbkk5hs=
|
||||
github.com/CosmWasm/go-cosmwasm v0.11.0-alpha2/go.mod h1:gAFCwllx97ejI+m9SqJQrmd2SBW7HA0fOjvWWJjM2uc=
|
||||
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||
|
|
|
@ -30,7 +30,7 @@ import (
|
|||
func TestGenesisExportImport(t *testing.T) {
|
||||
srcKeeper, srcCtx, srcStoreKeys, srcCleanup := setupKeeper(t)
|
||||
defer srcCleanup()
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
// store some test data
|
||||
|
@ -112,7 +112,7 @@ func TestGenesisExportImport(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestFailFastImport(t *testing.T) {
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
myCodeInfo := wasmTypes.CodeInfoFixture(wasmTypes.WithSHA256CodeHash(wasmCode))
|
||||
|
@ -402,7 +402,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) {
|
|||
keeper, ctx, _, dstCleanup := setupKeeper(t)
|
||||
defer dstCleanup()
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
wasmCodeHash := sha256.Sum256(wasmCode)
|
||||
|
|
|
@ -14,10 +14,10 @@ import (
|
|||
)
|
||||
|
||||
func TestUncompress(t *testing.T) {
|
||||
wasmRaw, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmRaw, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
wasmGzipped, err := ioutil.ReadFile("./testdata/contract.wasm.gzip")
|
||||
wasmGzipped, err := ioutil.ReadFile("./testdata/hackatom.wasm.gzip")
|
||||
require.NoError(t, err)
|
||||
|
||||
specs := map[string]struct {
|
||||
|
|
|
@ -43,7 +43,7 @@ func TestCreate(t *testing.T) {
|
|||
deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
|
||||
creator := createFakeFundedAccount(ctx, accKeeper, deposit)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "https://github.com/CosmWasm/wasmd/blob/master/x/wasm/testdata/escrow.wasm", "any/builder:tag", nil)
|
||||
|
@ -56,7 +56,7 @@ func TestCreate(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestCreateStoresInstantiatePermission(t *testing.T) {
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
var (
|
||||
deposit = sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
|
||||
|
@ -119,7 +119,7 @@ func TestCreateWithParamPermissions(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit)
|
||||
otherAddr := createFakeFundedAccount(ctx, accKeeper, deposit)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
specs := map[string]struct {
|
||||
|
@ -168,7 +168,7 @@ func TestCreateDuplicate(t *testing.T) {
|
|||
deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
|
||||
creator := createFakeFundedAccount(ctx, accKeeper, deposit)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
// create one copy
|
||||
|
@ -203,7 +203,7 @@ func TestCreateWithSimulation(t *testing.T) {
|
|||
deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
|
||||
creator := createFakeFundedAccount(ctx, accKeeper, deposit)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
// create this once in simulation mode
|
||||
|
@ -259,7 +259,7 @@ func TestCreateWithGzippedPayload(t *testing.T) {
|
|||
deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
|
||||
creator := createFakeFundedAccount(ctx, accKeeper, deposit)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm.gzip")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm.gzip")
|
||||
require.NoError(t, err)
|
||||
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "https://github.com/CosmWasm/wasmd/blob/master/x/wasm/testdata/escrow.wasm", "", nil)
|
||||
|
@ -268,7 +268,7 @@ func TestCreateWithGzippedPayload(t *testing.T) {
|
|||
// and verify content
|
||||
storedCode, err := keeper.GetByteCode(ctx, contractID)
|
||||
require.NoError(t, err)
|
||||
rawCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
rawCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, rawCode, storedCode)
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ func TestInstantiate(t *testing.T) {
|
|||
deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
|
||||
creator := createFakeFundedAccount(ctx, accKeeper, deposit)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
codeID, err := keeper.Create(ctx, creator, wasmCode, "https://github.com/CosmWasm/wasmd/blob/master/x/wasm/testdata/escrow.wasm", "", nil)
|
||||
|
@ -326,7 +326,7 @@ func TestInstantiate(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestInstantiateWithDeposit(t *testing.T) {
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
var (
|
||||
|
@ -388,7 +388,7 @@ func TestInstantiateWithDeposit(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestInstantiateWithPermissions(t *testing.T) {
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
var (
|
||||
|
@ -485,7 +485,7 @@ func TestExecute(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
fred := createFakeFundedAccount(ctx, accKeeper, topUp)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
@ -553,7 +553,7 @@ func TestExecute(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestExecuteWithDeposit(t *testing.T) {
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
var (
|
||||
|
@ -656,7 +656,7 @@ func TestExecuteWithPanic(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
fred := createFakeFundedAccount(ctx, accKeeper, topUp)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
@ -692,7 +692,7 @@ func TestExecuteWithCpuLoop(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
fred := createFakeFundedAccount(ctx, accKeeper, topUp)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
@ -740,7 +740,7 @@ func TestExecuteWithStorageLoop(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
fred := createFakeFundedAccount(ctx, accKeeper, topUp)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
@ -786,7 +786,7 @@ func TestMigrate(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
fred := createFakeFundedAccount(ctx, accKeeper, sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)))
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
originalCodeID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
@ -930,7 +930,7 @@ func TestMigrateWithDispatchedMessage(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
fred := createFakeFundedAccount(ctx, accKeeper, sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)))
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
burnerCode, err := ioutil.ReadFile("./testdata/burner.wasm")
|
||||
require.NoError(t, err)
|
||||
|
@ -1043,7 +1043,7 @@ func TestUpdateContractAdmin(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
fred := createFakeFundedAccount(ctx, accKeeper, topUp)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
originalContractID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
@ -1118,7 +1118,7 @@ func TestClearContractAdmin(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
fred := createFakeFundedAccount(ctx, accKeeper, topUp)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
originalContractID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
|
|
@ -24,7 +24,7 @@ func TestStoreCodeProposal(t *testing.T) {
|
|||
ctx, keepers := CreateTestInput(t, false, tempDir, "staking", nil, nil)
|
||||
govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
|
||||
wasmKeeper.setParams(ctx, types.Params{UploadAccess: types.AllowNobody, DefaultInstantiatePermission: types.Nobody})
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
var anyAddress sdk.AccAddress = make([]byte, sdk.AddrLen)
|
||||
|
@ -66,7 +66,7 @@ func TestInstantiateProposal(t *testing.T) {
|
|||
govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
|
||||
wasmKeeper.setParams(ctx, types.Params{UploadAccess: types.AllowNobody, DefaultInstantiatePermission: types.Nobody})
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
require.NoError(t, wasmKeeper.importCode(ctx, 1,
|
||||
|
@ -122,7 +122,7 @@ func TestMigrateProposal(t *testing.T) {
|
|||
govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
|
||||
wasmKeeper.setParams(ctx, types.Params{UploadAccess: types.AllowNobody, DefaultInstantiatePermission: types.Nobody})
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
codeInfoFixture := types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode))
|
||||
|
@ -196,7 +196,7 @@ func TestAdminProposals(t *testing.T) {
|
|||
otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, sdk.AddrLen)
|
||||
contractAddr = contractAddress(1, 1)
|
||||
)
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
specs := map[string]struct {
|
||||
|
|
|
@ -28,7 +28,7 @@ func TestQueryContractState(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
anyAddr := createFakeFundedAccount(ctx, accKeeper, topUp)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
contractID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
@ -162,7 +162,7 @@ func TestListContractByCodeOrdering(t *testing.T) {
|
|||
creator := createFakeFundedAccount(ctx, accKeeper, deposit)
|
||||
anyAddr := createFakeFundedAccount(ctx, accKeeper, topUp)
|
||||
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
codeID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
|
@ -320,7 +320,7 @@ func TestQueryContractHistory(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestQueryCodeList(t *testing.T) {
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
|
||||
specs := map[string]struct {
|
||||
|
|
|
@ -59,7 +59,7 @@ func initRecurseContract(t *testing.T) (contract sdk.AccAddress, creator sdk.Acc
|
|||
creator = createFakeFundedAccount(ctx, accKeeper, deposit.Add(deposit...))
|
||||
|
||||
// store the code
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
wasmCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
codeID, err := keeper.Create(ctx, creator, wasmCode, "", "", nil)
|
||||
require.NoError(t, err)
|
||||
|
|
|
@ -71,7 +71,7 @@ func TestMaskReflectContractSend(t *testing.T) {
|
|||
require.Equal(t, uint64(1), maskID)
|
||||
|
||||
// upload hackatom escrow code
|
||||
escrowCode, err := ioutil.ReadFile("./testdata/contract.wasm")
|
||||
escrowCode, err := ioutil.ReadFile("./testdata/hackatom.wasm")
|
||||
require.NoError(t, err)
|
||||
escrowID, err := keeper.Create(ctx, creator, escrowCode, "", "", nil)
|
||||
require.NoError(t, err)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
set -o errexit -o nounset -o pipefail
|
||||
command -v shellcheck > /dev/null && shellcheck "$0"
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: ./download_releases.sh RELEASE_TAG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tag="$1"
|
||||
|
||||
for contract in burner hackatom reflect staking; do
|
||||
url="https://github.com/CosmWasm/cosmwasm/releases/download/$tag/${contract}.wasm"
|
||||
echo "Downloading $url ..."
|
||||
wget -O "${contract}.wasm" "$url"
|
||||
done
|
||||
|
||||
# create the zip variant
|
||||
gzip -k hackatom.wasm
|
||||
mv hackatom.wasm.gz hackatom.wasm.gzip
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -188,7 +188,7 @@ func NewAbsoluteTxPosition(ctx sdk.Context) *AbsoluteTxPosition {
|
|||
}
|
||||
|
||||
// NewEnv initializes the environment for a contract instance
|
||||
func NewEnv(ctx sdk.Context, creator sdk.AccAddress, deposit sdk.Coins, contractAddr sdk.AccAddress) wasmTypes.Env {
|
||||
func NewEnv(ctx sdk.Context, contractAddr sdk.AccAddress) wasmTypes.Env {
|
||||
// safety checks before casting below
|
||||
if ctx.BlockHeight() < 0 {
|
||||
panic("Block height must never be negative")
|
||||
|
@ -205,10 +205,6 @@ func NewEnv(ctx sdk.Context, creator sdk.AccAddress, deposit sdk.Coins, contract
|
|||
TimeNanos: uint64(nano),
|
||||
ChainID: ctx.ChainID(),
|
||||
},
|
||||
Message: wasmTypes.MessageInfo{
|
||||
Sender: creator.String(),
|
||||
SentFunds: NewWasmCoins(deposit),
|
||||
},
|
||||
Contract: wasmTypes.ContractInfo{
|
||||
Address: contractAddr.String(),
|
||||
},
|
||||
|
@ -216,6 +212,14 @@ func NewEnv(ctx sdk.Context, creator sdk.AccAddress, deposit sdk.Coins, contract
|
|||
return env
|
||||
}
|
||||
|
||||
// NewInfo initializes the MessageInfo for a contract instance
|
||||
func NewInfo(creator sdk.AccAddress, deposit sdk.Coins) wasmTypes.MessageInfo {
|
||||
return wasmTypes.MessageInfo{
|
||||
Sender: creator.String(),
|
||||
SentFunds: NewWasmCoins(deposit),
|
||||
}
|
||||
}
|
||||
|
||||
// NewWasmCoins translates between Cosmos SDK coins and Wasm coins
|
||||
func NewWasmCoins(cosmosCoins sdk.Coins) (wasmCoins []wasmTypes.Coin) {
|
||||
for _, coin := range cosmosCoins {
|
||||
|
|
Loading…
Reference in New Issue