Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
pinosu committed Jul 27, 2023
1 parent 80d4a61 commit d219af2
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 134 deletions.
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func NewTgradeApp(
govRouter,
wasmDir,
twasmConfig,
supportedFeatures,
availableCapabilities,
wasmOpts...,
)

Expand Down
2 changes: 1 addition & 1 deletion testing/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func encodeBech32Addr(src []byte) string {

// ContractBech32Address build a tgrade bech32 contract address
func ContractBech32Address(codeID, instanceID uint64) string {
return encodeBech32Addr(wasmkeeper.BuildContractAddress(codeID, instanceID))
return encodeBech32Addr(wasmkeeper.BuildContractAddressClassic(codeID, instanceID))
}

func AwaitValsetEpochCompleted(t *testing.T) {
Expand Down
18 changes: 9 additions & 9 deletions x/poe/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ import (
func TestBootstrapPoEContracts(t *testing.T) {
t.Skip()
var (
engagementContractAddr = wasmkeeper.BuildContractAddress(1, 1)
ocContractAddr = wasmkeeper.BuildContractAddress(2, 2)
stakingContractAdddr = wasmkeeper.BuildContractAddress(3, 3)
mixerContractAddr = wasmkeeper.BuildContractAddress(4, 4)
communityPoolContractAddr = wasmkeeper.BuildContractAddress(5, 5)
valsetContractAddr = wasmkeeper.BuildContractAddress(6, 6)
distributionContractAddr = wasmkeeper.BuildContractAddress(1, 6) // created by a contract so not really persisted
ocGovProposalContractAddr = wasmkeeper.BuildContractAddress(7, 7) // instanceID = 7
valVotingContractAddr = wasmkeeper.BuildContractAddress(8, 8)
engagementContractAddr = wasmkeeper.BuildContractAddressClassic(1, 1)
ocContractAddr = wasmkeeper.BuildContractAddressClassic(2, 2)
stakingContractAdddr = wasmkeeper.BuildContractAddressClassic(3, 3)
mixerContractAddr = wasmkeeper.BuildContractAddressClassic(4, 4)
communityPoolContractAddr = wasmkeeper.BuildContractAddressClassic(5, 5)
valsetContractAddr = wasmkeeper.BuildContractAddressClassic(6, 6)
distributionContractAddr = wasmkeeper.BuildContractAddressClassic(1, 6) // created by a contract so not really persisted
ocGovProposalContractAddr = wasmkeeper.BuildContractAddressClassic(7, 7) // instanceID = 7
valVotingContractAddr = wasmkeeper.BuildContractAddressClassic(8, 8)
)
var (
defaultLimit uint64 = 20
Expand Down
5 changes: 3 additions & 2 deletions x/poe/contract/tg4_engagement_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package contract_test
import (
_ "embed"
"encoding/json"
"testing"

"github.com/confio/tgrade/x/poe"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
Expand All @@ -26,7 +27,7 @@ func TestEngagementUpdateAdmin(t *testing.T) {
var bootstrapAccountAddr sdk.AccAddress = rand.Bytes(address.Len)

k := example.TWasmKeeper.GetContractKeeper()
codeID, err := k.Create(ctx, bootstrapAccountAddr, tg4Engagement, nil)
codeID, _, err := k.Create(ctx, bootstrapAccountAddr, tg4Engagement, nil)
require.NoError(t, err)

var newAddress sdk.AccAddress = rand.Bytes(address.Len)
Expand Down
2 changes: 1 addition & 1 deletion x/poe/contract/tgrade_trusted_circle_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestInitTrustedCircle(t *testing.T) {
initBz, err := json.Marshal(init)
require.NoError(t, err)
t.Log(string(initBz))
codeID, err := contractKeeper.Create(ctx, creator, tgTrustedCircles, nil)
codeID, _, err := contractKeeper.Create(ctx, creator, tgTrustedCircles, nil)
require.NoError(t, err)
// when
contractAddr, _, err := contractKeeper.Instantiate(ctx, codeID, creator, nil, initBz, "poe", sdk.NewCoins(depositAmount))
Expand Down
2 changes: 1 addition & 1 deletion x/poe/contract/tgrade_validator_voting_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestValidatorsGovProposal(t *testing.T) {
var maxDuration int64 = 6000000

// upload any contract that is not pinned
codeID, err := contractKeeper.Create(ctx, anyAddress, validatorVotingContract, nil)
codeID, _, err := contractKeeper.Create(ctx, anyAddress, validatorVotingContract, nil)
require.NoError(t, err)
require.False(t, example.TWasmKeeper.IsPinnedCode(ctx, codeID), "pinned")
specs := map[string]struct {
Expand Down
2 changes: 1 addition & 1 deletion x/twasm/address_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import (

// ContractAddress generator function. Same as in wasm
func ContractAddress(codeID, instanceID uint64) sdk.AccAddress {
return wasmkeeper.BuildContractAddress(codeID, instanceID)
return wasmkeeper.BuildContractAddressClassic(codeID, instanceID)
}
2 changes: 1 addition & 1 deletion x/twasm/keeper/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,5 +340,5 @@ func setContractPrivilege(t *testing.T, ctx sdk.Context, keepers TestKeepers, co

// genContractAddress generates a contract address as wasmd keeper does
func genContractAddress(codeID, instanceID uint64) sdk.AccAddress {
return wasmkeeper.BuildContractAddress(codeID, instanceID)
return wasmkeeper.BuildContractAddressClassic(codeID, instanceID)
}
4 changes: 2 additions & 2 deletions x/twasm/testing/contract_keeper_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var _ wasmtypes.ContractOpsKeeper = &ContractOpsKeeperMock{}

// ContractOpsKeeperMock implements wasmtypes.ContractOpsKeeper for testing purpose
type ContractOpsKeeperMock struct {
CreateFn func(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *wasmtypes.AccessConfig) (codeID uint64, err error)
CreateFn func(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *wasmtypes.AccessConfig) (codeID uint64, checksum []byte, err error)
InstantiateFn func(ctx sdk.Context, codeID uint64, creator, admin sdk.AccAddress, initMsg []byte, label string, deposit sdk.Coins) (sdk.AccAddress, []byte, error)
ExecuteFn func(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error)
MigrateFn func(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte) ([]byte, error)
Expand All @@ -24,7 +24,7 @@ type ContractOpsKeeperMock struct {
SetAccessConfigFn func(ctx sdk.Context, codeID uint64, config wasmtypes.AccessConfig) error
}

func (m ContractOpsKeeperMock) Create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *wasmtypes.AccessConfig) (codeID uint64, err error) {
func (m ContractOpsKeeperMock) Create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *wasmtypes.AccessConfig) (codeID uint64, checksum []byte, err error) {
if m.CreateFn == nil {
panic("not expected to be called")
}
Expand Down
115 changes: 0 additions & 115 deletions x/twasm/types/wasm_genesis_helper.go

This file was deleted.

0 comments on commit d219af2

Please sign in to comment.