Skip to content

Commit

Permalink
bump Babylon contracts (#15)
Browse files Browse the repository at this point in the history
TODO before merging

- [x] wait until
babylonchain/babylon-contract#163 and
babylonchain/babylon-contract#162 are merged
  • Loading branch information
SebastianElvis authored Jun 19, 2024
1 parent 9d22dbd commit cac4ac9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 19 deletions.
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 @@
77a165d570b7f78d315d94f7adde850cd8874547
ed2bb75d109c579ad9b1e8ad1efe089421326028
16 changes: 4 additions & 12 deletions x/babylon/contract/out_message.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
package contract

import "time"

// SudoMsg is a message sent from the Babylon module to a smart contract
type SudoMsg struct {
BeginBlockMsg *BeginBlock `json:"begin_block,omitempty"`
EndBlockMsg *EndBlock `json:"end_block,omitempty"`
}

type BeginBlock struct {
Height int64 `json:"height"` // Height is the height of the block
HashHex string `json:"hash_hex"` // HashHex is the hash of the block in hex
Time time.Time `json:"time"` // Time is the time of the block
ChainID string `json:"chain_id"` // ChainId is the chain ID of the block
AppHashHex string `json:"app_hash_hex"` // AppHashHex is the app hash of the block in hex
HashHex string `json:"hash_hex"` // HashHex is the hash of the block in hex
AppHashHex string `json:"app_hash_hex"` // AppHashHex is the app hash of the block in hex
}

type EndBlock struct {
Height int64 `json:"height"` // Height is the height of the block
HashHex string `json:"hash_hex"` // HashHex is the hash of the block in hex
Time time.Time `json:"time"` // Time is the time of the block
ChainID string `json:"chain_id"` // ChainId is the chain ID of the block
AppHashHex string `json:"app_hash_hex"` // AppHashHex is the app hash of the block in hex
HashHex string `json:"hash_hex"` // HashHex is the hash of the block in hex
AppHashHex string `json:"app_hash_hex"` // AppHashHex is the app hash of the block in hex
}
6 changes: 0 additions & 6 deletions x/babylon/keeper/wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ func (k Keeper) SendBeginBlockMsg(ctx sdk.Context) error {
headerInfo := ctx.HeaderInfo()
msg := contract.SudoMsg{
BeginBlockMsg: &contract.BeginBlock{
Height: headerInfo.Height,
HashHex: hex.EncodeToString(headerInfo.Hash),
Time: headerInfo.Time,
ChainID: headerInfo.ChainID,
AppHashHex: hex.EncodeToString(headerInfo.AppHash),
},
}
Expand All @@ -49,10 +46,7 @@ func (k Keeper) SendEndBlockMsg(ctx sdk.Context) error {
headerInfo := ctx.HeaderInfo()
msg := contract.SudoMsg{
EndBlockMsg: &contract.EndBlock{
Height: headerInfo.Height,
HashHex: hex.EncodeToString(headerInfo.Hash),
Time: headerInfo.Time,
ChainID: headerInfo.ChainID,
AppHashHex: hex.EncodeToString(headerInfo.AppHash),
},
}
Expand Down

0 comments on commit cac4ac9

Please sign in to comment.