Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: tallying and block finalization #446

Merged
merged 25 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions clientcontroller/cosmwasm/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,7 @@ func (wc *CosmwasmConsumerController) queryLatestBlocks(startAfter, limit *uint6
return blocks, nil
}

//nolint:unused
func (wc *CosmwasmConsumerController) queryIndexedBlock(height uint64) (*IndexedBlock, error) {
func (wc *CosmwasmConsumerController) QueryIndexedBlock(height uint64) (*IndexedBlock, error) {
// Construct the query message
queryMsgStruct := QueryMsgBlock{
Block: BlockQuery{
Expand Down Expand Up @@ -369,7 +368,7 @@ func (wc *CosmwasmConsumerController) queryIndexedBlock(height uint64) (*Indexed

func (wc *CosmwasmConsumerController) QueryBlock(height uint64) (*fptypes.BlockInfo, error) {
//// Use the helper function to get the IndexedBlock
//resp, err := wc.queryIndexedBlock(height)
//resp, err := wc.QueryIndexedBlock(height)
//if err != nil {
// return nil, err
//}
Expand Down Expand Up @@ -435,7 +434,7 @@ func (wc *CosmwasmConsumerController) QueryLastCommittedPublicRand(fpPk *btcec.P

func (wc *CosmwasmConsumerController) QueryIsBlockFinalized(height uint64) (bool, error) {
//// Use the helper function to get the IndexedBlock
//resp, err := wc.queryIndexedBlock(height)
//resp, err := wc.QueryIndexedBlock(height)
//if err != nil {
// return false, err
//}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
gusin13 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/CosmWasm/wasmd v0.51.0
github.com/avast/retry-go/v4 v4.5.1
github.com/babylonchain/babylon v0.8.6-0.20240527005816-ae2182029020
github.com/babylonchain/babylon-sdk/demo v0.0.0-20240624102351-3a809d4fdcce
github.com/babylonchain/babylon-sdk/demo v0.0.0-20240628002428-0a58d82eef68
github.com/btcsuite/btcd v0.24.0
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd/btcutil v1.1.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/babylonchain/babylon-private v0.8.6-0.20240618010559-dc7b6269474d h1:rCrkS45Znained3VZvxOEfgWhqC298FypC0PM6A0eFg=
github.com/babylonchain/babylon-private v0.8.6-0.20240618010559-dc7b6269474d/go.mod h1:Tdi+29Y+DzCaaz0V0sBRXF1tXXLnH6JHJsOG8uktWLU=
github.com/babylonchain/babylon-sdk/demo v0.0.0-20240624102351-3a809d4fdcce h1:73v+DHCPD4Wi42O2NPJfor+adBiNRkAVddf27idbHrQ=
github.com/babylonchain/babylon-sdk/demo v0.0.0-20240624102351-3a809d4fdcce/go.mod h1:X4QovCWMwqMjoTriu18w4gfqX1sYqOWRnZwXGYD8bnE=
github.com/babylonchain/babylon-sdk/demo v0.0.0-20240628002428-0a58d82eef68 h1:UXM8I8EPmeRdLMoYERNVMX8DFhWmvRBfLcG2lEUcwqI=
github.com/babylonchain/babylon-sdk/demo v0.0.0-20240628002428-0a58d82eef68/go.mod h1:X4QovCWMwqMjoTriu18w4gfqX1sYqOWRnZwXGYD8bnE=
github.com/babylonchain/babylon-sdk/x v0.0.0-20240624102351-3a809d4fdcce h1:UYg5QEbMUBt3IIVdcTDXqVTsj1iJoFQBfGC+e6uEtZg=
github.com/babylonchain/babylon-sdk/x v0.0.0-20240624102351-3a809d4fdcce/go.mod h1:Ojrlnwh9z7fvmTUzYH4Tk+8hWSctCrZYWiC5+t4X32I=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Expand Down
5 changes: 4 additions & 1 deletion itest/babylon_node_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,12 @@ func NewBabylonNodeHandler(t *testing.T, covenantQuorum int, covenantPks []*type
"babylond",
"start",
fmt.Sprintf("--home=%s", nodeDataDir),
"--log_level=debug",
"--log_level=trace",
"--trace",
)

fmt.Println("Starting babylond with command: ", startCmd.String())

startCmd.Stdout = f

return &BabylonNodeHandler{
Expand Down
Binary file modified itest/bytecode/babylon_contract.wasm
Binary file not shown.
Binary file modified itest/bytecode/btc_staking.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion itest/bytecode/version.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's tag v0.7.1 or so.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i intend to use a newer commit than the tagged one, maybe once we have the next release in babylon-contract i'll bump the version here as well

Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.7.0-rc.2
a33989c5c7c11b882bc7d5f50c1dfe30bae47fa6
106 changes: 66 additions & 40 deletions itest/cosmwasm/bcd/bcd_consumer_e2e_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build e2e_bcd
// +build e2e_bcd

package e2etest_bcd

import (
Expand All @@ -23,10 +20,14 @@ import (
// 1. Upload Babylon and BTC staking contracts to bcd chain
// 2. Instantiate Babylon contract with admin
// 3. Register consumer chain to Babylon
// 4. Register finality provider to Babylon
// 5. Inject finality provider and delegation in BTC staking contract using admin
// 4. Inject consumer fp in BTC staking contract using admin
// 6. Start the finality provider daemon and app
// 7. Wait for fp daemon to submit public randomness and finality signature
// 8. Inject consumer delegation in BTC staking contract using admin, this will give voting power to fp
// 9. Ensure fp has voting power in smart contract
// 10. Ensure finality sigs are being submitted by fp daemon and block is finalized
// NOTE: the delegation is injected after ensuring pub randomness loop in fp daemon has started
// this order is necessary otherwise pub randomness loop takes time to start and due to this blocks won't get finalized.
func TestConsumerFpLifecycle(t *testing.T) {
ctm := StartBcdTestManager(t)
defer ctm.Stop(t)
Expand Down Expand Up @@ -81,6 +82,7 @@ func TestConsumerFpLifecycle(t *testing.T) {
require.NoError(t, err)

// register consumer fps to babylon
// this will be submitted to babylon once fp daemon starts
app := ctm.Fpa
cfg := app.GetConfig()
fpName := e2eutils.FpNamePrefix + bcdChainID
Expand All @@ -96,42 +98,22 @@ func TestConsumerFpLifecycle(t *testing.T) {
_, err = app.RegisterFinalityProvider(fpPk.MarshalHex())
require.NoError(t, err)

// inject fp and delegation in smart contract using admin
msg := e2eutils.GenBtcStakingExecMsg(fpPk.MarshalHex())
msgBytes, err := json.Marshal(msg)
// inject fp in smart contract using admin
fpMsg := e2eutils.GenBtcStakingFpExecMsg(fpPk.MarshalHex())
fpMsgBytes, err := json.Marshal(fpMsg)
require.NoError(t, err)
_, err = ctm.BcdConsumerClient.ExecuteContract(msgBytes)
_, err = ctm.BcdConsumerClient.ExecuteContract(fpMsgBytes)
require.NoError(t, err)

// query finality providers in smart contract
consumerFpsResp, err := ctm.BcdConsumerClient.QueryFinalityProviders()
require.NoError(t, err)
require.NotNil(t, consumerFpsResp)
require.Len(t, consumerFpsResp.Fps, 1)
require.Equal(t, msg.BtcStaking.NewFP[0].ConsumerID, consumerFpsResp.Fps[0].ConsumerId)
require.Equal(t, msg.BtcStaking.NewFP[0].BTCPKHex, consumerFpsResp.Fps[0].BtcPkHex)

// query delegations in smart contract
consumerDelsResp, err := ctm.BcdConsumerClient.QueryDelegations()
require.NoError(t, err)
require.NotNil(t, consumerDelsResp)
require.Len(t, consumerDelsResp.Delegations, 1)
require.Empty(t, consumerDelsResp.Delegations[0].UndelegationInfo.DelegatorUnbondingSig) // assert there is no delegator unbonding sig
require.Equal(t, msg.BtcStaking.ActiveDel[0].BTCPkHex, consumerDelsResp.Delegations[0].BtcPkHex)
require.Equal(t, msg.BtcStaking.ActiveDel[0].StartHeight, consumerDelsResp.Delegations[0].StartHeight)
require.Equal(t, msg.BtcStaking.ActiveDel[0].EndHeight, consumerDelsResp.Delegations[0].EndHeight)
require.Equal(t, msg.BtcStaking.ActiveDel[0].TotalSat, consumerDelsResp.Delegations[0].TotalSat)
require.Equal(t, msg.BtcStaking.ActiveDel[0].StakingTx, base64.StdEncoding.EncodeToString(consumerDelsResp.Delegations[0].StakingTx)) // make sure to compare b64 encoded strings
require.Equal(t, msg.BtcStaking.ActiveDel[0].SlashingTx, base64.StdEncoding.EncodeToString(consumerDelsResp.Delegations[0].SlashingTx)) // make sure to compare b64 encoded strings

// ensure fp has voting power in smart contract
consumerFpsByPowerResp, err := ctm.BcdConsumerClient.QueryFinalityProvidersByPower()
require.NoError(t, err)
require.NotNil(t, consumerFpsByPowerResp)
require.Len(t, consumerFpsByPowerResp.Fps, 1)
require.Equal(t, msg.BtcStaking.NewFP[0].BTCPKHex, consumerFpsByPowerResp.Fps[0].BtcPkHex)
require.Equal(t, consumerDelsResp.Delegations[0].TotalSat, consumerFpsByPowerResp.Fps[0].Power)
require.Equal(t, fpMsg.BtcStaking.NewFP[0].ConsumerID, consumerFpsResp.Fps[0].ConsumerId)
require.Equal(t, fpMsg.BtcStaking.NewFP[0].BTCPKHex, consumerFpsResp.Fps[0].BtcPkHex)

// start finality provider daemon
err = app.StartHandlingFinalityProvider(fpPk, e2eutils.Passphrase)
require.NoError(t, err)
fpIns, err := app.GetFinalityProviderInstance(fpPk)
Expand All @@ -140,6 +122,7 @@ func TestConsumerFpLifecycle(t *testing.T) {
require.NoError(t, err)

// ensure consumer finality providers are stored in Babylon
// this will happen after the finality provider daemon has started
require.Eventually(t, func() bool {
fps, err := ctm.BBNClient.QueryConsumerFinalityProviders(bcdChainID)
if err != nil {
Expand All @@ -161,36 +144,79 @@ func TestConsumerFpLifecycle(t *testing.T) {
return true
}, e2eutils.EventuallyWaitTimeOut, e2eutils.EventuallyPollTime)

wasmdNodeStatus, err := ctm.BcdConsumerClient.GetCometNodeStatus()
require.NoError(t, err)
cometLatestHeight := wasmdNodeStatus.SyncInfo.LatestBlockHeight
lookupHeight := cometLatestHeight + 20 // TODO: this is a hack, as its possible the randomness/sigs submission loops haven't started yet

// ensure pub rand is submitted to smart contract
require.Eventually(t, func() bool {
fpPubRandResp, err := ctm.BcdConsumerClient.QueryLastCommittedPublicRand(fpPk.MustToBTCPK(), 1)
if err != nil {
t.Logf("failed to query last committed public rand: %s", err.Error())
return false
}
if fpPubRandResp == nil {
if len(fpPubRandResp) == 0 {
return false
}

return true
}, e2eutils.EventuallyWaitTimeOut, e2eutils.EventuallyPollTime)

// inject delegation in smart contract using admin
delMsg := e2eutils.GenBtcStakingDelExecMsg(fpPk.MarshalHex())
delMsgBytes, err := json.Marshal(delMsg)
require.NoError(t, err)
_, err = ctm.BcdConsumerClient.ExecuteContract(delMsgBytes)
require.NoError(t, err)

// query delegations in smart contract
consumerDelsResp, err := ctm.BcdConsumerClient.QueryDelegations()
require.NoError(t, err)
require.NotNil(t, consumerDelsResp)
require.Len(t, consumerDelsResp.Delegations, 1)
require.Empty(t, consumerDelsResp.Delegations[0].UndelegationInfo.DelegatorUnbondingSig) // assert there is no delegator unbonding sig
require.Equal(t, delMsg.BtcStaking.ActiveDel[0].BTCPkHex, consumerDelsResp.Delegations[0].BtcPkHex)
require.Equal(t, delMsg.BtcStaking.ActiveDel[0].StartHeight, consumerDelsResp.Delegations[0].StartHeight)
require.Equal(t, delMsg.BtcStaking.ActiveDel[0].EndHeight, consumerDelsResp.Delegations[0].EndHeight)
require.Equal(t, delMsg.BtcStaking.ActiveDel[0].TotalSat, consumerDelsResp.Delegations[0].TotalSat)
require.Equal(t, delMsg.BtcStaking.ActiveDel[0].StakingTx, base64.StdEncoding.EncodeToString(consumerDelsResp.Delegations[0].StakingTx)) // make sure to compare b64 encoded strings
require.Equal(t, delMsg.BtcStaking.ActiveDel[0].SlashingTx, base64.StdEncoding.EncodeToString(consumerDelsResp.Delegations[0].SlashingTx)) // make sure to compare b64 encoded strings

// ensure fp has voting power in smart contract
consumerFpsByPowerResp, err := ctm.BcdConsumerClient.QueryFinalityProvidersByPower()
require.NoError(t, err)
require.NotNil(t, consumerFpsByPowerResp)
require.Len(t, consumerFpsByPowerResp.Fps, 1)
require.Equal(t, fpMsg.BtcStaking.NewFP[0].BTCPKHex, consumerFpsByPowerResp.Fps[0].BtcPkHex)
require.Equal(t, delMsg.BtcStaking.ActiveDel[0].TotalSat, consumerFpsByPowerResp.Fps[0].Power)

// get comet latest height
wasmdNodeStatus, err := ctm.BcdConsumerClient.GetCometNodeStatus()
require.NoError(t, err)
// TODO: this is a hack as its possible that latest comet height is less than activated height
// and the sigs/finalization can only happen after activated height
lookupHeight := wasmdNodeStatus.SyncInfo.LatestBlockHeight + 5

// ensure finality signature is submitted to smart contract
require.Eventually(t, func() bool {
fpSigsResponse, err := ctm.BcdConsumerClient.QueryFinalitySignature(fpPk.MarshalHex(), uint64(lookupHeight))
if err != nil {
t.Logf("failed to query finality signature: %s", err.Error())
return false
}
if fpSigsResponse == nil {
if fpSigsResponse == nil || fpSigsResponse.Signature == nil || len(fpSigsResponse.Signature) == 0 {
return false
}
return true
}, e2eutils.EventuallyWaitTimeOut, e2eutils.EventuallyPollTime)

// ensure latest comet block is finalized
require.Eventually(t, func() bool {
idxBlockedResponse, err := ctm.BcdConsumerClient.QueryIndexedBlock(uint64(lookupHeight))
if err != nil {
t.Logf("failed to query indexed block: %s", err.Error())
return false
}
if idxBlockedResponse == nil {
return false
}
if fpSigsResponse.Signature == nil || len(fpSigsResponse.Signature) == 0 {
if !idxBlockedResponse.Finalized {
return false
}
return true
Expand Down
50 changes: 46 additions & 4 deletions itest/cosmwasm/bcd/bcd_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func NewBcdNodeHandler(t *testing.T) *BcdNodeHandler {

setupBcd(t, testDir)
Copy link
Contributor

@maurolacy maurolacy Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires that bcd is built and installed. Let's use a submodule for it, along with a commit / tag reference, and add the build instructions to the test and test-e2e targets.

For the test-e2e test targets, perhaps a series of docker images is better. But I think this is OK for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires that bcd is built and installed

bcd command is installed using make target then later the node is started using bcd cli

Let's use a submodule for it, along with a commit / tag reference, and add the build instructions to the test and test-e2e targets.

not sure if i got this properly, can you elaborate how would a submodule be used here? Docker image is a good idea similar to the way tests are done in babylon repo, but this requires major refactoring

Copy link
Contributor

@maurolacy maurolacy Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, similar to how babylon-deployment works. But instead of compiling a docker image using the build-docker target in the sub-module, you just issue make build && make install.

Not sure this is the right approach / place to do this though. Perhaps these tests, which are a kind of integration / e2e test, should live in the babylon-deployment repo instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have opened a issue to track this probably will be done in a separate pr
#477

cmd := bcdStartCmd(t, testDir)
fmt.Println("Starting bcd with command:", cmd.String())
return &BcdNodeHandler{
cmd: cmd,
pidFile: "", // empty for now, will be set after start
Expand Down Expand Up @@ -138,9 +139,37 @@ func bcdInit(homeDir string) error {

func bcdUpdateGenesisFile(homeDir string) error {
genesisPath := filepath.Join(homeDir, "config", "genesis.json")
sedCmd := fmt.Sprintf("sed -i. 's/\"stake\"/\"%s\"/' %s", common.WasmStake, genesisPath)
_, err := common.RunCommand("sh", "-c", sedCmd)
return err

// Update "stake" placeholder
sedCmd1 := fmt.Sprintf("sed -i. 's/\"stake\"/\"%s\"/' %s", common.WasmStake, genesisPath)
fmt.Println("Executing command:", sedCmd1)
_, err := common.RunCommand("sh", "-c", sedCmd1)
if err != nil {
return fmt.Errorf("failed to update stake in genesis.json: %w", err)
}

// TODO: this is a hack to update babylon module params in bcd chain
// this is needed to ensure tallying and block finalization works properly
babylonContractAddr := "bbnc14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9syx25zf"
btcStakingContractAddr := "bbnc1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqgn0kq0"

// Update babylon_contract_address
sedCmd2 := fmt.Sprintf("sed -i. 's/\"babylon_contract_address\": \"\"/\"babylon_contract_address\": \"%s\"/' %s", babylonContractAddr, genesisPath)
fmt.Println("Executing command:", sedCmd2)
_, err = common.RunCommand("sh", "-c", sedCmd2)
if err != nil {
return fmt.Errorf("failed to update babylon_contract_address in genesis.json: %w", err)
}

// Update btc_staking_contract_address
sedCmd3 := fmt.Sprintf("sed -i. 's/\"btc_staking_contract_address\": \"\"/\"btc_staking_contract_address\": \"%s\"/' %s", btcStakingContractAddr, genesisPath)
fmt.Println("Executing command:", sedCmd3)
_, err = common.RunCommand("sh", "-c", sedCmd3)
if err != nil {
return fmt.Errorf("failed to update btc_staking_contract_address in genesis.json: %w", err)
}
gusin13 marked this conversation as resolved.
Show resolved Hide resolved

return nil
}

func bcdKeysAdd(homeDir string) error {
Expand All @@ -153,6 +182,16 @@ func bcdAddValidatorGenesisAccount(homeDir string) error {
return err
}

func bcdVersion() error {
cmd := exec.Command("bcd", "version")
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("failed to execute command: %w", err)
}
fmt.Printf("bcd version:\n%s\n", string(output))
return nil
}

func bcdGentxValidator(homeDir string) error {
_, err := common.RunCommand("bcd", "genesis", "gentx", "validator", fmt.Sprintf("250000000%s", common.WasmStake), "--chain-id="+bcdChainID, "--amount="+fmt.Sprintf("250000000%s", common.WasmStake), "--home", homeDir, "--keyring-backend=test")
return err
Expand Down Expand Up @@ -181,6 +220,9 @@ func setupBcd(t *testing.T, testDir string) {

err = bcdCollectGentxs(testDir)
require.NoError(t, err)

err = bcdVersion()
require.NoError(t, err)
}

func bcdStartCmd(t *testing.T, testDir string) *exec.Cmd {
Expand All @@ -189,7 +231,7 @@ func bcdStartCmd(t *testing.T, testDir string) *exec.Cmd {
"--home", testDir,
"--rpc.laddr", fmt.Sprintf("tcp://0.0.0.0:%d", bcdRpcPort),
"--p2p.laddr", fmt.Sprintf("tcp://0.0.0.0:%d", bcdP2pPort),
"--log_level=info",
"--log_level=trace",
"--trace",
}

Expand Down
1 change: 1 addition & 0 deletions itest/cosmwasm/bcd/bcd_test_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keyring"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
"github.com/stretchr/testify/require"

"go.uber.org/zap"
)

Expand Down
40 changes: 40 additions & 0 deletions itest/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,46 @@ func GenBtcStakingExecMsg(fpHex string) cosmwasm.ExecMsg {
return executeMessage
}

func GenBtcStakingFpExecMsg(fpHex string) cosmwasm.ExecMsg {
// generate random finality provider
newFp := genRandomFinalityProvider()

// replace field so finality provider is linked
newFp.BTCPKHex = fpHex

// create the ExecMsg instance with BtcStaking set for NewFP
executeMessage := cosmwasm.ExecMsg{
BtcStaking: &cosmwasm.BtcStaking{
NewFP: []cosmwasm.NewFinalityProvider{newFp},
ActiveDel: []cosmwasm.ActiveBtcDelegation{},
SlashedDel: []cosmwasm.SlashedBtcDelegation{},
UnbondedDel: []cosmwasm.UnbondedBtcDelegation{},
},
}

return executeMessage
}

func GenBtcStakingDelExecMsg(fpHex string) cosmwasm.ExecMsg {
// generate random delegation
_, newDel := genRandomBtcDelegation()

// replace field so delegation is linked to finality provider
newDel.FpBtcPkList = []string{fpHex}

// create the ExecMsg instance with BtcStaking set for ActiveDel
executeMessage := cosmwasm.ExecMsg{
BtcStaking: &cosmwasm.BtcStaking{
NewFP: []cosmwasm.NewFinalityProvider{},
ActiveDel: []cosmwasm.ActiveBtcDelegation{newDel},
SlashedDel: []cosmwasm.SlashedBtcDelegation{},
UnbondedDel: []cosmwasm.UnbondedBtcDelegation{},
},
}

return executeMessage
}

func GenPubRandomnessExecMsg(fpHex, commitment, sig string, startHeight, numPubRand uint64) cosmwasm.ExecMsg {
// create the ExecMsg instance with CommitPublicRandomness set
executeMessage := cosmwasm.ExecMsg{
Expand Down
2 changes: 1 addition & 1 deletion itest/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

var (
EventuallyWaitTimeOut = 2 * time.Minute
EventuallyWaitTimeOut = 3 * time.Minute
EventuallyPollTime = 500 * time.Millisecond
FpNamePrefix = "test-fp-"
MonikerPrefix = "moniker-"
Expand Down
Loading