-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.go
30 lines (26 loc) · 862 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"encoding/hex"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
clienttypes "github.com/cosmos/ibc-go/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/modules/core/04-channel/types"
"github.com/bandprotocol/bandchain-packet/packet"
)
func main() {
calldata, _ := hex.DecodeString("030000004254436400000000000000")
req := packet.OracleRequestPacketData{
ClientID: "",
OracleScriptID: 1,
Calldata: calldata,
AskCount: 1,
MinCount: 1,
FeeLimit: sdk.NewCoins(sdk.NewCoin("uband", sdk.NewInt(10000))),
PrepareGas: 100,
ExecuteGas: 100,
}
// This can be data of packet
fmt.Println(string(req.GetBytes()))
packet := channeltypes.NewPacket(req.GetBytes(), 0, "src-port", "src-channel", "dst-port", "dst-channel", clienttypes.NewHeight(0, 0), 10)
_ = packet
}