2021-06-29 04:55:44 -07:00
|
|
|
package vaa
|
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"encoding/binary"
|
2022-06-21 12:18:16 -07:00
|
|
|
|
2021-06-29 04:55:44 -07:00
|
|
|
"github.com/ethereum/go-ethereum/common"
|
2023-02-14 10:01:15 -08:00
|
|
|
"github.com/holiman/uint256"
|
2021-06-29 04:55:44 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
// CoreModule is the identifier of the Core module (which is used for governance messages)
|
|
|
|
var CoreModule = []byte{00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0x43, 0x6f, 0x72, 0x65}
|
|
|
|
|
2022-12-07 09:20:11 -08:00
|
|
|
// WasmdModule is the identifier of the Wormchain Wasmd module (which is used for governance messages)
|
|
|
|
var WasmdModule = [32]byte{00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 0x57, 0x61, 0x73, 0x6D, 0x64, 0x4D, 0x6F, 0x64, 0x75, 0x6C, 0x65}
|
|
|
|
var WasmdModuleStr = string(WasmdModule[:])
|
|
|
|
|
|
|
|
type GovernanceAction uint8
|
|
|
|
|
|
|
|
var (
|
|
|
|
// Wormhole governance actions
|
|
|
|
ActionContractUpgrade GovernanceAction = 1
|
|
|
|
ActionGuardianSetUpdate GovernanceAction = 2
|
|
|
|
|
|
|
|
// Wormchain cosmwasm governance actions
|
|
|
|
ActionStoreCode GovernanceAction = 1
|
|
|
|
ActionInstantiateContract GovernanceAction = 2
|
2023-02-02 10:49:52 -08:00
|
|
|
ActionMigrateContract GovernanceAction = 3
|
2023-02-13 16:40:11 -08:00
|
|
|
|
|
|
|
// Wormhole tokenbridge governance actions
|
|
|
|
ActionRegisterChain GovernanceAction = 1
|
|
|
|
ActionUpgradeTokenBridge GovernanceAction = 2
|
|
|
|
ActionModifyBalance GovernanceAction = 3
|
2022-12-07 09:20:11 -08:00
|
|
|
)
|
|
|
|
|
2021-06-29 04:55:44 -07:00
|
|
|
type (
|
|
|
|
// BodyContractUpgrade is a governance message to perform a contract upgrade of the core module
|
|
|
|
BodyContractUpgrade struct {
|
|
|
|
ChainID ChainID
|
|
|
|
NewContract Address
|
|
|
|
}
|
|
|
|
|
|
|
|
// BodyGuardianSetUpdate is a governance message to set a new guardian set
|
|
|
|
BodyGuardianSetUpdate struct {
|
|
|
|
Keys []common.Address
|
|
|
|
NewIndex uint32
|
|
|
|
}
|
2021-09-30 07:58:54 -07:00
|
|
|
|
2021-09-30 11:57:44 -07:00
|
|
|
// BodyTokenBridgeRegisterChain is a governance message to register a chain on the token bridge
|
|
|
|
BodyTokenBridgeRegisterChain struct {
|
2021-10-01 03:26:05 -07:00
|
|
|
Module string
|
2021-09-30 07:58:54 -07:00
|
|
|
ChainID ChainID
|
|
|
|
EmitterAddress Address
|
|
|
|
}
|
node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:
(*vaa.VAA)(0xc0004f4510)({
Version: (uint8) 1,
GuardianSetIndex: (uint32) 0,
Signatures: ([]*vaa.Signature) (len=1 cap=1) {
(*vaa.Signature)(0xc0003b0370)({
Index: (uint8) 0,
Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
})
},
Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
Nonce: (uint32) 1375049878,
Sequence: (uint64) 3557202656914991802,
ConsistencyLevel: (uint8) 32,
EmitterChain: (vaa.ChainID) solana,
EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
Payload: ([]uint8) (len=67 cap=1000) {
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 54 6f 6b 65 6e 42 72 69 64 67 65 |.....TokenBridge|
00000020 02 00 05 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 90 fb 16 72 08 af 45 5b b1 37 78 01 63 b7 b7 a9 |...r..E[.7x.c...|
00000040 a1 0c 16 |...|
}
})
Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-08 10:41:43 -07:00
|
|
|
|
|
|
|
// BodyTokenBridgeUpgradeContract is a governance message to upgrade the token bridge.
|
|
|
|
BodyTokenBridgeUpgradeContract struct {
|
|
|
|
Module string
|
|
|
|
TargetChainID ChainID
|
|
|
|
NewContract Address
|
|
|
|
}
|
2022-12-06 11:10:32 -08:00
|
|
|
|
2023-02-13 16:40:11 -08:00
|
|
|
// BodyTokenBridgeModifyBalance is a governance message to modify accountant balances for the tokenbridge.
|
|
|
|
BodyTokenBridgeModifyBalance struct {
|
|
|
|
Module string
|
|
|
|
TargetChainID ChainID
|
|
|
|
Sequence uint64
|
|
|
|
ChainId ChainID
|
|
|
|
TokenChain ChainID
|
|
|
|
TokenAddress Address
|
|
|
|
Kind uint8
|
2023-02-14 10:01:15 -08:00
|
|
|
Amount *uint256.Int
|
2023-02-13 16:40:11 -08:00
|
|
|
Reason string
|
|
|
|
}
|
|
|
|
|
2022-12-06 11:10:32 -08:00
|
|
|
// BodyWormchainStoreCode is a governance message to upload a new cosmwasm contract to wormchain
|
|
|
|
BodyWormchainStoreCode struct {
|
|
|
|
WasmHash [32]byte
|
|
|
|
}
|
|
|
|
|
|
|
|
// BodyWormchainInstantiateContract is a governance message to instantiate a cosmwasm contract on wormchain
|
|
|
|
BodyWormchainInstantiateContract struct {
|
|
|
|
InstantiationParamsHash [32]byte
|
|
|
|
}
|
2023-02-02 10:49:52 -08:00
|
|
|
|
|
|
|
// BodyWormchainInstantiateContract is a governance message to migrate a cosmwasm contract on wormchain
|
|
|
|
BodyWormchainMigrateContract struct {
|
|
|
|
MigrationParamsHash [32]byte
|
|
|
|
}
|
2021-06-29 04:55:44 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func (b BodyContractUpgrade) Serialize() []byte {
|
|
|
|
buf := new(bytes.Buffer)
|
|
|
|
|
|
|
|
// Module
|
|
|
|
buf.Write(CoreModule)
|
|
|
|
// Action
|
2022-12-07 09:20:11 -08:00
|
|
|
MustWrite(buf, binary.BigEndian, ActionContractUpgrade)
|
2021-06-29 04:55:44 -07:00
|
|
|
// ChainID
|
|
|
|
MustWrite(buf, binary.BigEndian, uint16(b.ChainID))
|
|
|
|
|
|
|
|
buf.Write(b.NewContract[:])
|
|
|
|
|
|
|
|
return buf.Bytes()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b BodyGuardianSetUpdate) Serialize() []byte {
|
|
|
|
buf := new(bytes.Buffer)
|
|
|
|
|
|
|
|
// Module
|
|
|
|
buf.Write(CoreModule)
|
|
|
|
// Action
|
2022-12-07 09:20:11 -08:00
|
|
|
MustWrite(buf, binary.BigEndian, ActionGuardianSetUpdate)
|
2021-06-29 04:55:44 -07:00
|
|
|
// ChainID - 0 for universal
|
|
|
|
MustWrite(buf, binary.BigEndian, uint16(0))
|
|
|
|
|
|
|
|
MustWrite(buf, binary.BigEndian, b.NewIndex)
|
|
|
|
MustWrite(buf, binary.BigEndian, uint8(len(b.Keys)))
|
|
|
|
for _, k := range b.Keys {
|
|
|
|
buf.Write(k[:])
|
|
|
|
}
|
|
|
|
|
|
|
|
return buf.Bytes()
|
|
|
|
}
|
2021-09-30 07:58:54 -07:00
|
|
|
|
2021-09-30 11:57:44 -07:00
|
|
|
func (r BodyTokenBridgeRegisterChain) Serialize() []byte {
|
2022-12-12 11:58:38 -08:00
|
|
|
payload := &bytes.Buffer{}
|
|
|
|
MustWrite(payload, binary.BigEndian, r.ChainID)
|
|
|
|
payload.Write(r.EmitterAddress[:])
|
|
|
|
// target chain 0 = universal
|
2023-02-13 16:40:11 -08:00
|
|
|
return serializeBridgeGovernanceVaa(r.Module, ActionRegisterChain, 0, payload.Bytes())
|
2022-12-06 11:10:32 -08:00
|
|
|
}
|
2021-10-01 03:26:05 -07:00
|
|
|
|
2022-12-06 11:10:32 -08:00
|
|
|
func (r BodyTokenBridgeUpgradeContract) Serialize() []byte {
|
2023-02-13 16:40:11 -08:00
|
|
|
return serializeBridgeGovernanceVaa(r.Module, ActionUpgradeTokenBridge, r.TargetChainID, r.NewContract[:])
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r BodyTokenBridgeModifyBalance) Serialize() []byte {
|
|
|
|
payload := &bytes.Buffer{}
|
|
|
|
MustWrite(payload, binary.BigEndian, r.Sequence)
|
|
|
|
MustWrite(payload, binary.BigEndian, r.ChainId)
|
|
|
|
MustWrite(payload, binary.BigEndian, r.TokenChain)
|
|
|
|
payload.Write(r.TokenAddress[:])
|
|
|
|
payload.WriteByte(r.Kind)
|
|
|
|
|
2023-02-14 10:01:15 -08:00
|
|
|
amount_bytes := r.Amount.Bytes32()
|
|
|
|
payload.Write(amount_bytes[:])
|
|
|
|
|
2023-02-13 16:40:11 -08:00
|
|
|
reason := make([]byte, 32)
|
|
|
|
|
|
|
|
// truncate or pad "reason"
|
2023-02-15 07:10:40 -08:00
|
|
|
count := copy(reason, r.Reason)
|
|
|
|
for i := range reason[count:] {
|
|
|
|
reason[i] = ' '
|
2023-02-13 16:40:11 -08:00
|
|
|
}
|
|
|
|
payload.Write(reason)
|
|
|
|
|
|
|
|
return serializeBridgeGovernanceVaa(r.Module, ActionModifyBalance, r.TargetChainID, payload.Bytes())
|
2022-12-06 11:10:32 -08:00
|
|
|
}
|
2021-09-30 07:58:54 -07:00
|
|
|
|
2022-12-06 11:10:32 -08:00
|
|
|
func (r BodyWormchainStoreCode) Serialize() []byte {
|
2022-12-12 11:58:38 -08:00
|
|
|
return serializeBridgeGovernanceVaa(WasmdModuleStr, ActionStoreCode, ChainIDWormchain, r.WasmHash[:])
|
2022-12-06 11:10:32 -08:00
|
|
|
}
|
2021-09-30 07:58:54 -07:00
|
|
|
|
2022-12-06 11:10:32 -08:00
|
|
|
func (r BodyWormchainInstantiateContract) Serialize() []byte {
|
2022-12-12 11:58:38 -08:00
|
|
|
return serializeBridgeGovernanceVaa(WasmdModuleStr, ActionInstantiateContract, ChainIDWormchain, r.InstantiationParamsHash[:])
|
2021-09-30 07:58:54 -07:00
|
|
|
}
|
node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:
(*vaa.VAA)(0xc0004f4510)({
Version: (uint8) 1,
GuardianSetIndex: (uint32) 0,
Signatures: ([]*vaa.Signature) (len=1 cap=1) {
(*vaa.Signature)(0xc0003b0370)({
Index: (uint8) 0,
Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
})
},
Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
Nonce: (uint32) 1375049878,
Sequence: (uint64) 3557202656914991802,
ConsistencyLevel: (uint8) 32,
EmitterChain: (vaa.ChainID) solana,
EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
Payload: ([]uint8) (len=67 cap=1000) {
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 54 6f 6b 65 6e 42 72 69 64 67 65 |.....TokenBridge|
00000020 02 00 05 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 90 fb 16 72 08 af 45 5b b1 37 78 01 63 b7 b7 a9 |...r..E[.7x.c...|
00000040 a1 0c 16 |...|
}
})
Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-08 10:41:43 -07:00
|
|
|
|
2023-02-02 10:49:52 -08:00
|
|
|
func (r BodyWormchainMigrateContract) Serialize() []byte {
|
|
|
|
return serializeBridgeGovernanceVaa(WasmdModuleStr, ActionMigrateContract, ChainIDWormchain, r.MigrationParamsHash[:])
|
|
|
|
}
|
|
|
|
|
2022-12-12 11:58:38 -08:00
|
|
|
func serializeBridgeGovernanceVaa(module string, actionId GovernanceAction, chainId ChainID, payload []byte) []byte {
|
2022-12-06 11:10:32 -08:00
|
|
|
if len(module) > 32 {
|
node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:
(*vaa.VAA)(0xc0004f4510)({
Version: (uint8) 1,
GuardianSetIndex: (uint32) 0,
Signatures: ([]*vaa.Signature) (len=1 cap=1) {
(*vaa.Signature)(0xc0003b0370)({
Index: (uint8) 0,
Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
})
},
Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
Nonce: (uint32) 1375049878,
Sequence: (uint64) 3557202656914991802,
ConsistencyLevel: (uint8) 32,
EmitterChain: (vaa.ChainID) solana,
EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
Payload: ([]uint8) (len=67 cap=1000) {
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 54 6f 6b 65 6e 42 72 69 64 67 65 |.....TokenBridge|
00000020 02 00 05 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 90 fb 16 72 08 af 45 5b b1 37 78 01 63 b7 b7 a9 |...r..E[.7x.c...|
00000040 a1 0c 16 |...|
}
})
Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-08 10:41:43 -07:00
|
|
|
panic("module longer than 32 byte")
|
|
|
|
}
|
|
|
|
|
|
|
|
buf := &bytes.Buffer{}
|
|
|
|
|
|
|
|
// Write token bridge header
|
2022-12-06 11:10:32 -08:00
|
|
|
for i := 0; i < (32 - len(module)); i++ {
|
node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:
(*vaa.VAA)(0xc0004f4510)({
Version: (uint8) 1,
GuardianSetIndex: (uint32) 0,
Signatures: ([]*vaa.Signature) (len=1 cap=1) {
(*vaa.Signature)(0xc0003b0370)({
Index: (uint8) 0,
Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
})
},
Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
Nonce: (uint32) 1375049878,
Sequence: (uint64) 3557202656914991802,
ConsistencyLevel: (uint8) 32,
EmitterChain: (vaa.ChainID) solana,
EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
Payload: ([]uint8) (len=67 cap=1000) {
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 54 6f 6b 65 6e 42 72 69 64 67 65 |.....TokenBridge|
00000020 02 00 05 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 90 fb 16 72 08 af 45 5b b1 37 78 01 63 b7 b7 a9 |...r..E[.7x.c...|
00000040 a1 0c 16 |...|
}
})
Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-08 10:41:43 -07:00
|
|
|
buf.WriteByte(0x00)
|
|
|
|
}
|
2022-12-06 11:10:32 -08:00
|
|
|
buf.Write([]byte(module))
|
node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:
(*vaa.VAA)(0xc0004f4510)({
Version: (uint8) 1,
GuardianSetIndex: (uint32) 0,
Signatures: ([]*vaa.Signature) (len=1 cap=1) {
(*vaa.Signature)(0xc0003b0370)({
Index: (uint8) 0,
Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
})
},
Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
Nonce: (uint32) 1375049878,
Sequence: (uint64) 3557202656914991802,
ConsistencyLevel: (uint8) 32,
EmitterChain: (vaa.ChainID) solana,
EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
Payload: ([]uint8) (len=67 cap=1000) {
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 54 6f 6b 65 6e 42 72 69 64 67 65 |.....TokenBridge|
00000020 02 00 05 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 90 fb 16 72 08 af 45 5b b1 37 78 01 63 b7 b7 a9 |...r..E[.7x.c...|
00000040 a1 0c 16 |...|
}
})
Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-08 10:41:43 -07:00
|
|
|
// Write action ID
|
2022-12-06 11:10:32 -08:00
|
|
|
MustWrite(buf, binary.BigEndian, actionId)
|
node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:
(*vaa.VAA)(0xc0004f4510)({
Version: (uint8) 1,
GuardianSetIndex: (uint32) 0,
Signatures: ([]*vaa.Signature) (len=1 cap=1) {
(*vaa.Signature)(0xc0003b0370)({
Index: (uint8) 0,
Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
})
},
Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
Nonce: (uint32) 1375049878,
Sequence: (uint64) 3557202656914991802,
ConsistencyLevel: (uint8) 32,
EmitterChain: (vaa.ChainID) solana,
EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
Payload: ([]uint8) (len=67 cap=1000) {
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 54 6f 6b 65 6e 42 72 69 64 67 65 |.....TokenBridge|
00000020 02 00 05 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 90 fb 16 72 08 af 45 5b b1 37 78 01 63 b7 b7 a9 |...r..E[.7x.c...|
00000040 a1 0c 16 |...|
}
})
Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-08 10:41:43 -07:00
|
|
|
// Write target chain
|
2022-12-06 11:10:32 -08:00
|
|
|
MustWrite(buf, binary.BigEndian, chainId)
|
node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:
(*vaa.VAA)(0xc0004f4510)({
Version: (uint8) 1,
GuardianSetIndex: (uint32) 0,
Signatures: ([]*vaa.Signature) (len=1 cap=1) {
(*vaa.Signature)(0xc0003b0370)({
Index: (uint8) 0,
Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
})
},
Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
Nonce: (uint32) 1375049878,
Sequence: (uint64) 3557202656914991802,
ConsistencyLevel: (uint8) 32,
EmitterChain: (vaa.ChainID) solana,
EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
Payload: ([]uint8) (len=67 cap=1000) {
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 54 6f 6b 65 6e 42 72 69 64 67 65 |.....TokenBridge|
00000020 02 00 05 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 90 fb 16 72 08 af 45 5b b1 37 78 01 63 b7 b7 a9 |...r..E[.7x.c...|
00000040 a1 0c 16 |...|
}
})
Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-08 10:41:43 -07:00
|
|
|
// Write emitter address of chain to be registered
|
2022-12-06 11:10:32 -08:00
|
|
|
buf.Write(payload[:])
|
node: add BridgeUpgradeContract governance VAA
Example VAA produced by the template:
(*vaa.VAA)(0xc0004f4510)({
Version: (uint8) 1,
GuardianSetIndex: (uint32) 0,
Signatures: ([]*vaa.Signature) (len=1 cap=1) {
(*vaa.Signature)(0xc0003b0370)({
Index: (uint8) 0,
Signature: (vaa.SignatureData) (len=65 cap=65) 0f97ec9093c21ccc4ce544898ed5c21b66ab4c90be894642fbb43474ed9fb48a26d6e12f3397b9fdab160fee64e797d26599a2a9d81a4bf4bc98970b5fa5122501
})
},
Timestamp: (time.Time) 1970-01-01 00:00:00 +0000 UTC,
Nonce: (uint32) 1375049878,
Sequence: (uint64) 3557202656914991802,
ConsistencyLevel: (uint8) 32,
EmitterChain: (vaa.ChainID) solana,
EmitterAddress: (vaa.Address) (len=32 cap=32) 0000000000000000000000000000000000000000000000000000000000000004,
Payload: ([]uint8) (len=67 cap=1000) {
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000010 00 00 00 00 00 54 6f 6b 65 6e 42 72 69 64 67 65 |.....TokenBridge|
00000020 02 00 05 00 00 00 00 00 00 00 00 00 00 00 00 02 |................|
00000030 90 fb 16 72 08 af 45 5b b1 37 78 01 63 b7 b7 a9 |...r..E[.7x.c...|
00000040 a1 0c 16 |...|
}
})
Change-Id: Ibe95db01e1bc0a9c36e1be06920a389db886fdd1
2021-10-08 10:41:43 -07:00
|
|
|
|
|
|
|
return buf.Bytes()
|
|
|
|
}
|