Skip to content

Commit

Permalink
Merge pull request #286 from icon-project/feat/e2e-cleanup-codes
Browse files Browse the repository at this point in the history
chore: removed unused ibc related codes and functinos
  • Loading branch information
bcsainju authored Jul 16, 2024
2 parents 395abf5 + cea0e17 commit 0002b52
Show file tree
Hide file tree
Showing 23 changed files with 184 additions and 4,153 deletions.
52 changes: 51 additions & 1 deletion go.work.sum

Large diffs are not rendered by default.

22 changes: 3 additions & 19 deletions test/chains/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ package chains
import (
"context"

"github.com/icon-project/centralized-relay/test/interchaintest/_internal/blockdb"
"github.com/icon-project/centralized-relay/test/interchaintest/ibc"

"os"
)

Expand All @@ -15,33 +12,20 @@ const (
)

type Chain interface {
ibc.Chain
DeployContract(ctx context.Context, keyName string) (context.Context, error)
QueryContract(ctx context.Context, contractAddress, methodName string, params map[string]interface{}) (context.Context, error)
ExecuteContract(ctx context.Context, contractAddress, keyName, methodName string, param map[string]interface{}) (context.Context, error)
GetLastBlock(ctx context.Context) (context.Context, error)
GetBlockByHeight(ctx context.Context) (context.Context, error)
FindTxs(ctx context.Context, height uint64) ([]blockdb.Tx, error)
BuildWallets(ctx context.Context, keyName string) (ibc.Wallet, error)
// ibc.Chain
Height(ctx context.Context) (uint64, error)
Config() ChainConfig
GetRelayConfig(ctx context.Context, rlyHome string, keyName string) ([]byte, error)
SetupXCall(ctx context.Context) error
SetupConnection(ctx context.Context, target Chain) error
FindTargetXCallMessage(ctx context.Context, target Chain, height uint64, to string) (*XCallResponse, error)
SendPacketXCall(ctx context.Context, keyName, _to string, data, rollback []byte) (context.Context, error)
XCall(ctx context.Context, targetChain Chain, keyName, _to string, data, rollback []byte) (*XCallResponse, error)
ExecuteCall(ctx context.Context, reqId, data string) (context.Context, error)
ExecuteRollback(ctx context.Context, sn string) (context.Context, error)
FindCallMessage(ctx context.Context, startHeight uint64, from, to, sn string) (string, string, error)
FindCallResponse(ctx context.Context, startHeight uint64, sn string) (string, error)
FindRollbackExecutedMessage(ctx context.Context, startHeight uint64, sn string) (string, error)
GetContractAddress(key string) string
DeployXCallMockApp(ctx context.Context, keyName string, connections []XCallConnection) error
PauseNode(context.Context) error
UnpauseNode(context.Context) error
InitEventListener(ctx context.Context, contract string) EventListener

BackupConfig() ([]byte, error)
RestoreConfig([]byte) error
}

func GetEnvOrDefault(key, defaultValue string) string {
Expand Down
28 changes: 27 additions & 1 deletion test/chains/chainConfig.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package chains

import "github.com/icon-project/centralized-relay/test/interchaintest/ibc"
import (
"github.com/icon-project/centralized-relay/test/interchaintest/ibc"
ibcv8 "github.com/strangelove-ventures/interchaintest/v8/ibc"
)

type ChainConfig struct {
Type string `mapstructure:"type"`
Expand Down Expand Up @@ -47,3 +50,26 @@ func (c *ChainConfig) GetIBCChainConfig(chain *Chain) ibc.ChainConfig {
NoHostMount: c.NoHostMount,
}
}

func (c *ChainConfig) FromIBCChainConfig(ibc ibcv8.ChainConfig) ChainConfig {

return ChainConfig{
Type: ibc.Type,
Name: ibc.Name,
ChainID: ibc.ChainID,
Images: DockerImage{
Repository: ibc.Images[0].Repository,
Version: ibc.Images[0].Version,
UidGid: ibc.Images[0].UidGid,
},
Bin: ibc.Bin,
Bech32Prefix: ibc.Bech32Prefix,
Denom: ibc.Denom,
CoinType: ibc.CoinType,
SkipGenTx: ibc.SkipGenTx,
GasPrices: ibc.GasPrices,
GasAdjustment: ibc.GasAdjustment,
TrustingPeriod: ibc.TrustingPeriod,
NoHostMount: ibc.NoHostMount,
}
}
Loading

0 comments on commit 0002b52

Please sign in to comment.