Skip to content

Commit

Permalink
Merge branch 'master' into dzmitryhil/fail-xrpl-scanner-in-case-of-error
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitryhil authored Apr 5, 2024
2 parents 17ba565 + 3ee4fe0 commit e39b4eb
Show file tree
Hide file tree
Showing 7 changed files with 752 additions and 448 deletions.
7 changes: 7 additions & 0 deletions integration-tests/bridge.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package integrationtests

// BridgeConfig the deployed bridge config.
type BridgeConfig struct {
ContractAddress string
OwnerMnemonic string
}
18 changes: 8 additions & 10 deletions integration-tests/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"testing"
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"

Expand All @@ -20,9 +19,9 @@ var chains Chains

// flag variables.
var (
coreumCfg CoreumChainConfig
xrplCfg XRPLChainConfig
contractAddressString string
coreumCfg CoreumChainConfig
xrplCfg XRPLChainConfig
bridgeCfg BridgeConfig
)

// Chains struct holds chains required for the testing.
Expand All @@ -39,7 +38,8 @@ func init() {
flag.StringVar(&xrplCfg.RPCAddress, "xrpl-rpc-address", "http://localhost:5005", "RPC address of xrpl node")
flag.StringVar(&xrplCfg.FundingSeed, "xrpl-funding-seed", "snoPBrXtMeMyMHUVTgbuqAfg1SUTb", "Funding XRPL account seed required by tests")
// this is the default address used in znet
flag.StringVar(&contractAddressString, "contract-address", "devcore14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sd4f0ak", "Smart contract address of the bridge")
flag.StringVar(&bridgeCfg.ContractAddress, "contract-address", "devcore14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sd4f0ak", "Smart contract address of the bridge (znet)")
flag.StringVar(&bridgeCfg.OwnerMnemonic, "owner-mnemonic", "analyst evil lucky job exhaust inform note where grant file already exit vibrant come finger spatial absorb enter aisle orange soldier false attend response", "Smart contract owner of the bridge (znet)")

// accept testing flags
testing.Init()
Expand Down Expand Up @@ -79,9 +79,7 @@ func NewTestingContext(t *testing.T) (context.Context, Chains) {
return testCtx, chains
}

// GetContractAddress returns the contract address for the bridge.
func GetContractAddress(t *testing.T) sdk.AccAddress {
address, err := sdk.AccAddressFromBech32(contractAddressString)
require.NoError(t, err)
return address
// GetBridgeConfig returns the bridge config.
func GetBridgeConfig() BridgeConfig {
return bridgeCfg
}
Loading

0 comments on commit e39b4eb

Please sign in to comment.