Skip to content

Commit cba5bd8

Browse files
Thoralf-MDaughterOfMars
authored andcommitted
feat!: rename types for iota PR iotaledger/iota#3499 (#9)
1 parent 2b1b87e commit cba5bd8

File tree

4 files changed

+48
-133
lines changed

4 files changed

+48
-133
lines changed

crates/sui-sdk-types/src/lib.rs

Lines changed: 43 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -19,139 +19,54 @@ mod transaction;
1919
mod type_tag;
2020
mod u256;
2121

22-
pub use address::Address;
23-
pub use address::AddressParseError;
24-
pub use checkpoint::CheckpointCommitment;
25-
pub use checkpoint::CheckpointContents;
26-
pub use checkpoint::CheckpointData;
27-
pub use checkpoint::CheckpointSequenceNumber;
28-
pub use checkpoint::CheckpointSummary;
29-
pub use checkpoint::CheckpointTimestamp;
30-
pub use checkpoint::CheckpointTransaction;
31-
pub use checkpoint::CheckpointTransactionInfo;
32-
pub use checkpoint::EndOfEpochData;
33-
pub use checkpoint::EpochId;
34-
pub use checkpoint::ProtocolVersion;
35-
pub use checkpoint::SignedCheckpointSummary;
36-
pub use checkpoint::StakeUnit;
37-
pub use crypto::Bls12381PublicKey;
38-
pub use crypto::Bls12381Signature;
39-
pub use crypto::Bn254FieldElement;
40-
pub use crypto::CircomG1;
41-
pub use crypto::CircomG2;
42-
pub use crypto::Claim;
43-
pub use crypto::Ed25519PublicKey;
44-
pub use crypto::Ed25519Signature;
45-
pub use crypto::Intent;
46-
pub use crypto::IntentAppId;
47-
pub use crypto::IntentScope;
48-
pub use crypto::IntentVersion;
49-
pub use crypto::Jwk;
50-
pub use crypto::JwkId;
51-
pub use crypto::MultisigAggregatedSignature;
52-
pub use crypto::MultisigCommittee;
53-
pub use crypto::MultisigMember;
54-
pub use crypto::MultisigMemberPublicKey;
55-
pub use crypto::MultisigMemberSignature;
56-
pub use crypto::PasskeyAuthenticator;
57-
pub use crypto::PasskeyPublicKey;
58-
pub use crypto::Secp256k1PublicKey;
59-
pub use crypto::Secp256k1Signature;
60-
pub use crypto::Secp256r1PublicKey;
61-
pub use crypto::Secp256r1Signature;
62-
pub use crypto::SignatureScheme;
63-
pub use crypto::SimpleSignature;
64-
pub use crypto::UserSignature;
65-
pub use crypto::ValidatorAggregatedSignature;
66-
pub use crypto::ValidatorCommittee;
67-
pub use crypto::ValidatorCommitteeMember;
68-
pub use crypto::ValidatorSignature;
69-
pub use crypto::ZkLoginAuthenticator;
70-
pub use crypto::ZkLoginInputs;
71-
pub use crypto::ZkLoginProof;
72-
pub use crypto::ZkLoginPublicIdentifier;
73-
pub use digest::CheckpointContentsDigest;
74-
pub use digest::CheckpointDigest;
75-
pub use digest::ConsensusCommitDigest;
76-
pub use digest::Digest;
77-
pub use digest::DigestParseError;
78-
pub use digest::EffectsAuxiliaryDataDigest;
79-
pub use digest::ObjectDigest;
80-
pub use digest::SigningDigest;
81-
pub use digest::TransactionDigest;
82-
pub use digest::TransactionEffectsDigest;
83-
pub use digest::TransactionEventsDigest;
84-
pub use effects::ChangedObject;
85-
pub use effects::IdOperation;
86-
pub use effects::ModifiedAtVersion;
87-
pub use effects::ObjectIn;
88-
pub use effects::ObjectOut;
89-
pub use effects::ObjectReferenceWithOwner;
90-
pub use effects::TransactionEffects;
91-
pub use effects::TransactionEffectsV1;
92-
pub use effects::TransactionEffectsV2;
93-
pub use effects::UnchangedSharedKind;
94-
pub use effects::UnchangedSharedObject;
95-
pub use events::BalanceChange;
96-
pub use events::Event;
97-
pub use events::TransactionEvents;
98-
pub use execution_status::CommandArgumentError;
99-
pub use execution_status::ExecutionError;
100-
pub use execution_status::ExecutionStatus;
101-
pub use execution_status::MoveLocation;
102-
pub use execution_status::PackageUpgradeError;
103-
pub use execution_status::TypeArgumentError;
22+
pub use address::{Address, AddressParseError};
23+
pub use checkpoint::{
24+
CheckpointCommitment, CheckpointContents, CheckpointData, CheckpointSequenceNumber,
25+
CheckpointSummary, CheckpointTimestamp, CheckpointTransaction, CheckpointTransactionInfo,
26+
EndOfEpochData, EpochId, ProtocolVersion, SignedCheckpointSummary, StakeUnit,
27+
};
28+
pub use crypto::{
29+
Bls12381PublicKey, Bls12381Signature, Bn254FieldElement, CircomG1, CircomG2, Claim,
30+
Ed25519PublicKey, Ed25519Signature, Intent, IntentAppId, IntentScope, IntentVersion, Jwk,
31+
JwkId, MultisigAggregatedSignature, MultisigCommittee, MultisigMember, MultisigMemberPublicKey,
32+
MultisigMemberSignature, PasskeyAuthenticator, PasskeyPublicKey, Secp256k1PublicKey,
33+
Secp256k1Signature, Secp256r1PublicKey, Secp256r1Signature, SignatureScheme, SimpleSignature,
34+
UserSignature, ValidatorAggregatedSignature, ValidatorCommittee, ValidatorCommitteeMember,
35+
ValidatorSignature, ZkLoginAuthenticator, ZkLoginInputs, ZkLoginProof, ZkLoginPublicIdentifier,
36+
};
37+
pub use digest::{
38+
CheckpointContentsDigest, CheckpointDigest, ConsensusCommitDigest, Digest, DigestParseError,
39+
EffectsAuxiliaryDataDigest, ObjectDigest, SigningDigest, TransactionDigest,
40+
TransactionEffectsDigest, TransactionEventsDigest,
41+
};
42+
pub use effects::{
43+
ChangedObject, IdOperation, ModifiedAtVersion, ObjectIn, ObjectOut, ObjectReferenceWithOwner,
44+
TransactionEffects, TransactionEffectsV1, TransactionEffectsV2, UnchangedSharedKind,
45+
UnchangedSharedObject,
46+
};
47+
pub use events::{BalanceChange, Event, TransactionEvents};
48+
pub use execution_status::{
49+
CommandArgumentError, ExecutionError, ExecutionStatus, MoveLocation, PackageUpgradeError,
50+
TypeArgumentError,
51+
};
10452
pub use gas::GasCostSummary;
105-
pub use object::GenesisObject;
106-
pub use object::MovePackage;
107-
pub use object::MoveStruct;
108-
pub use object::Object;
109-
pub use object::ObjectData;
110-
pub use object::ObjectReference;
111-
pub use object::ObjectType;
112-
pub use object::Owner;
113-
pub use object::TypeOrigin;
114-
pub use object::UpgradeInfo;
115-
pub use object::Version;
53+
pub use object::{
54+
GenesisObject, MovePackage, MoveStruct, Object, ObjectData, ObjectReference, ObjectType, Owner,
55+
TypeOrigin, UpgradeInfo, Version,
56+
};
11657
pub use object_id::ObjectId;
117-
pub use transaction::ActiveJwk;
118-
pub use transaction::Argument;
119-
pub use transaction::AuthenticatorStateExpire;
120-
pub use transaction::AuthenticatorStateUpdate;
121-
pub use transaction::CancelledTransaction;
122-
pub use transaction::ChangeEpoch;
123-
pub use transaction::Command;
124-
pub use transaction::ConsensusCommitPrologue;
125-
pub use transaction::ConsensusCommitPrologueV2;
126-
pub use transaction::ConsensusCommitPrologueV3;
127-
pub use transaction::ConsensusDeterminedVersionAssignments;
128-
pub use transaction::EndOfEpochTransactionKind;
129-
pub use transaction::GasPayment;
130-
pub use transaction::GenesisTransaction;
131-
pub use transaction::Input;
132-
pub use transaction::MakeMoveVector;
133-
pub use transaction::MergeCoins;
134-
pub use transaction::MoveCall;
135-
pub use transaction::ProgrammableTransaction;
136-
pub use transaction::Publish;
137-
pub use transaction::RandomnessStateUpdate;
138-
pub use transaction::SignedTransaction;
139-
pub use transaction::SplitCoins;
140-
pub use transaction::SystemPackage;
141-
pub use transaction::Transaction;
142-
pub use transaction::TransactionExpiration;
143-
pub use transaction::TransactionKind;
144-
pub use transaction::TransferObjects;
145-
pub use transaction::Upgrade;
146-
pub use transaction::VersionAssignment;
147-
pub use type_tag::Identifier;
148-
pub use type_tag::StructTag;
149-
pub use type_tag::TypeParseError;
150-
pub use type_tag::TypeTag;
151-
15258
#[cfg(feature = "serde")]
15359
#[cfg_attr(doc_cfg, doc(cfg(feature = "serde")))]
15460
pub(crate) use transaction::SignedTransactionWithIntentMessage;
61+
pub use transaction::{
62+
ActiveJwk, Argument, AuthenticatorStateExpire, AuthenticatorStateUpdate, CancelledTransaction,
63+
ChangeEpoch, Command, ConsensusCommitPrologue, ConsensusDeterminedVersionAssignments,
64+
EndOfEpochTransactionKind, GasPayment, GenesisTransaction, Input, MakeMoveVector, MergeCoins,
65+
MoveCall, ProgrammableTransaction, Publish, RandomnessStateUpdate, SignedTransaction,
66+
SplitCoins, SystemPackage, Transaction, TransactionExpiration, TransactionKind,
67+
TransferObjects, Upgrade, VersionAssignment,
68+
};
69+
pub use type_tag::{Identifier, StructTag, TypeParseError, TypeTag};
15570

15671
#[cfg(test)]
15772
mod serialization_proptests;

crates/sui-sdk-types/src/serialization_proptests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ serialization_test!(AuthenticatorStateExpire);
150150
serialization_test!(AuthenticatorStateUpdateV1);
151151
serialization_test!(ChangeEpoch);
152152
serialization_test!(Command);
153-
serialization_test!(ConsensusCommitPrologueV1);
153+
serialization_test!(ConsensusCommitPrologue);
154154
serialization_test!(CancelledTransaction);
155155
serialization_test!(ConsensusDeterminedVersionAssignments);
156156
serialization_test!(VersionAssignment);

crates/sui-sdk-types/src/transaction/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub struct AuthenticatorStateUpdateV1 {
180180
#[cfg_attr(feature = "serde", serde(with = "crate::_serde::ReadableDisplay"))]
181181
#[cfg_attr(feature = "schemars", schemars(with = "crate::_schemars::U64"))]
182182
pub authenticator_obj_initial_shared_version: u64,
183-
// to version this struct, do not add new fields. Instead, add a AuthenticatorStateUpdateV2
183+
// to version this struct, do not add new fields. Instead, add an AuthenticatorStateUpdate
184184
// to TransactionKind.
185185
}
186186

@@ -249,7 +249,7 @@ pub struct VersionAssignment {
249249
)]
250250
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
251251
#[cfg_attr(feature = "proptest", derive(test_strategy::Arbitrary))]
252-
pub struct ConsensusCommitPrologueV1 {
252+
pub struct ConsensusCommitPrologue {
253253
/// Epoch of the commit prologue transaction
254254
#[cfg_attr(feature = "serde", serde(with = "crate::_serde::ReadableDisplay"))]
255255
#[cfg_attr(feature = "schemars", schemars(with = "crate::_schemars::U64"))]

crates/sui-sdk-types/src/transaction/serialization.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ mod transaction {
124124
mod transaction_kind {
125125
use super::*;
126126
use crate::transaction::{
127-
AuthenticatorStateUpdateV1, ConsensusCommitPrologueV1, EndOfEpochTransactionKind,
127+
AuthenticatorStateUpdate, ConsensusCommitPrologue, EndOfEpochTransactionKind,
128128
GenesisTransaction, ProgrammableTransaction, RandomnessStateUpdate, TransactionKind,
129129
};
130130

@@ -1144,7 +1144,7 @@ mod test {
11441144

11451145
use crate::{
11461146
ObjectDigest, ObjectId, ObjectReference,
1147-
transaction::{Argument, Input, InputArgument, Transaction},
1147+
transaction::{Argument, Input, Transaction},
11481148
};
11491149

11501150
#[test]

0 commit comments

Comments
 (0)