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

bump Babylon contracts #15

Merged
merged 4 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Loading