Skip to content

Commit 9a977d3

Browse files
committed
add SuiConsensusCommitPrologueV3 definition
1 parent 6359ddb commit 9a977d3

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

types/transactions.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package types
22

33
import (
4+
"encoding/json"
5+
46
"github.com/coming-chat/go-sui/v2/lib"
57
"github.com/coming-chat/go-sui/v2/sui_types"
68
)
@@ -115,18 +117,24 @@ const (
115117

116118
type SuiTransactionBlockKind = lib.TagJson[TransactionBlockKind]
117119

120+
// https://github.com/MystenLabs/sui/blob/main/crates/sui-types/src/transaction.rs#L279
118121
type TransactionBlockKind struct {
119122
/// A system transaction that will update epoch information on-chain.
120123
ChangeEpoch *SuiChangeEpoch `json:"ChangeEpoch,omitempty"`
121124
/// A system transaction used for initializing the initial state of the chain.
122125
Genesis *SuiGenesisTransaction `json:"Genesis,omitempty"`
123126
/// A system transaction marking the start of a series of transactions scheduled as part of a
124-
/// checkpoint
125-
ConsensusCommitPrologue *SuiConsensusCommitPrologue `json:"ConsensusCommitPrologue,omitempty"`
127+
/// checkpoint (v1 - v3)
128+
ConsensusCommitPrologue *SuiConsensusCommitPrologue `json:"ConsensusCommitPrologue,omitempty"`
129+
ConsensusCommitPrologueV2 json.RawMessage `json:"ConsensusCommitPrologueV2,omitempty"`
130+
ConsensusCommitPrologueV3 *SuiConsensusCommitPrologueV3 `json:"ConsensusCommitPrologueV3,omitempty"`
126131
/// A series of transactions where the results of one transaction can be used in future
127132
/// transactions
128133
ProgrammableTransaction *SuiProgrammableTransactionBlock `json:"ProgrammableTransaction,omitempty"`
129134
// .. more transaction types go here
135+
AuthenticatorStateUpdate json.RawMessage `json:"AuthenticatorStateUpdate,omitempty"`
136+
EndOfEpochTransaction json.RawMessage `json:"EndOfEpochTransaction,omitempty"`
137+
RandomnessStateUpdate json.RawMessage `json:"RandomnessStateUpdate,omitempty"`
130138
}
131139

132140
func (t TransactionBlockKind) Tag() string {
@@ -155,6 +163,14 @@ type SuiConsensusCommitPrologue struct {
155163
CommitTimestampMs uint64 `json:"commit_timestamp_ms"`
156164
}
157165

166+
type SuiConsensusCommitPrologueV3 struct {
167+
Epoch *SafeSuiBigInt[uint64] `json:"epoch"`
168+
Round *SafeSuiBigInt[uint64] `json:"round"`
169+
CommitTimestampMs *SafeSuiBigInt[uint64] `json:"commit_timestamp_ms"`
170+
SubDagIndex *SafeSuiBigInt[uint64] `json:"sub_dag_index"`
171+
ConsensusCommitDigest sui_types.ObjectDigest `json:"consensus_commit_digest"`
172+
}
173+
158174
type SuiProgrammableTransactionBlock struct {
159175
Inputs []interface{} `json:"inputs"`
160176
/// The transactions to be executed sequentially. A failure in any transaction will

0 commit comments

Comments
 (0)