Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianElvis committed Aug 12, 2024
1 parent 9fd2ddd commit 1308970
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ func (s *BabylonSDKTestSuite) Test2MockConsumerFpDelegation() {
s.NoError(err)

// send msg to BTC staking contract via admin account
_, err = s.ConsumerCli.Exec(s.ConsumerContract.BTCStaking, msgBytes)
s.NoError(err)
res, err := s.ConsumerCli.Exec(s.ConsumerContract.BTCStaking, msgBytes)
s.NoError(err, res)

// ensure the finality provider is on consumer chain
consumerFps, err := s.ConsumerCli.Query(s.ConsumerContract.BTCStaking, Query{"finality_providers": {}})
Expand Down
24 changes: 10 additions & 14 deletions tests/e2e/types/datagen.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
func GenExecMessage() ExecuteMessage {
_, newDel := genBTCDelegation()

addr := datagen.GenRandomAccount().Address

newFp := NewFinalityProvider{
Description: &FinalityProviderDescription{
Moniker: "fp1",
Expand All @@ -26,13 +28,10 @@ func GenExecMessage() ExecuteMessage {
Details: "details",
},
Commission: "0.05",
BabylonPK: &PubKey{
Key: base64.StdEncoding.EncodeToString([]byte("mock_pub_rand")),
},
BTCPKHex: newDel.FpBtcPkList[0],
Pop: &ProofOfPossession{
Addr: addr,
BTCPKHex: newDel.FpBtcPkList[0],
Pop: &ProofOfPossessionBtc{
BTCSigType: 0,
BabylonSig: base64.StdEncoding.EncodeToString([]byte("mock_pub_rand")),
BTCSig: base64.StdEncoding.EncodeToString([]byte("mock_pub_rand")),
},
ConsumerID: "osmosis-1",
Expand Down Expand Up @@ -158,6 +157,7 @@ func convertBTCDelegationToActiveBtcDelegation(mockDel *bstypes.BTCDelegation) A
}

return ActiveBtcDelegation{
StakerAddr: mockDel.StakerAddr,
BTCPkHex: mockDel.BtcPk.MarshalHex(),
FpBtcPkList: fpBtcPkList,
StartHeight: mockDel.StartHeight,
Expand All @@ -177,9 +177,9 @@ func convertBTCDelegationToActiveBtcDelegation(mockDel *bstypes.BTCDelegation) A
type NewFinalityProvider struct {
Description *FinalityProviderDescription `json:"description,omitempty"`
Commission string `json:"commission"`
BabylonPK *PubKey `json:"babylon_pk,omitempty"`
Addr string `json:"addr,omitempty"`
BTCPKHex string `json:"btc_pk_hex"`
Pop *ProofOfPossession `json:"pop,omitempty"`
Pop *ProofOfPossessionBtc `json:"pop,omitempty"`
ConsumerID string `json:"consumer_id"`
}

Expand All @@ -191,13 +191,8 @@ type FinalityProviderDescription struct {
Details string `json:"details"`
}

type PubKey struct {
Key string `json:"key"`
}

type ProofOfPossession struct {
type ProofOfPossessionBtc struct {
BTCSigType int32 `json:"btc_sig_type"`
BabylonSig string `json:"babylon_sig"`
BTCSig string `json:"btc_sig"`
}

Expand All @@ -221,6 +216,7 @@ type BtcUndelegationInfo struct {
}

type ActiveBtcDelegation struct {
StakerAddr string `json:"staker_addr"`
BTCPkHex string `json:"btc_pk_hex"`
FpBtcPkList []string `json:"fp_btc_pk_list"`
StartHeight uint64 `json:"start_height"`
Expand Down
Binary file modified tests/testdata/babylon_contract.wasm
Binary file not shown.
Binary file modified tests/testdata/btc_staking.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/testdata/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.7.0-rc.2
79f5f8cc9bfae0a655663cbdea27d25fc482c50f

0 comments on commit 1308970

Please sign in to comment.