Skip to content

Commit 8f875b4

Browse files
committed
add placeholders for all known transaction-block kinds
1 parent 2e8eae1 commit 8f875b4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

types/transactions.go

Lines changed: 9 additions & 4 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,21 +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"`
126-
/// A system transaction marking the start of a series of transactions scheduled as part of a
127-
/// checkpoint (v3)
127+
/// checkpoint (v1 - v3)
128+
ConsensusCommitPrologue *SuiConsensusCommitPrologue `json:"ConsensusCommitPrologue,omitempty"`
129+
ConsensusCommitPrologueV2 json.RawMessage `json:"ConsensusCommitPrologueV2,omitempty"`
128130
ConsensusCommitPrologueV3 *SuiConsensusCommitPrologueV3 `json:"ConsensusCommitPrologueV3,omitempty"`
129131
/// A series of transactions where the results of one transaction can be used in future
130132
/// transactions
131133
ProgrammableTransaction *SuiProgrammableTransactionBlock `json:"ProgrammableTransaction,omitempty"`
132134
// .. 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"`
133138
}
134139

135140
func (t TransactionBlockKind) Tag() string {

0 commit comments

Comments
 (0)