Skip to content

Commit

Permalink
fix generate-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalajiarun committed Dec 1, 2023
1 parent af4a30b commit c6011f1
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 65 deletions.
120 changes: 64 additions & 56 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -614,16 +614,14 @@ sha256 = "1.4.0"
sha2_0_10_6 = { package = "sha2", version = "0.10.6" }
sha3 = "0.9.1"
siphasher = "0.3.10"
# For more information about why we are pinned to 1.0.152, see this issue:
# https://github.com/aptos-labs/aptos-core/issues/10424
serde = { version = "=1.0.152", features = ["derive", "rc"] }
serde = { version = "1.0.193", features = ["derive", "rc"] }
serde_bytes = "0.11.6"
serde_json = { version = "1.0.81", features = ["preserve_order", "arbitrary_precision"] } # Note: arbitrary_precision is required to parse u256 in JSON
serde_repr = "0.1"
serde_merge = "0.1.3"
serde-name = "0.1.1"
serde-generate = { git = "https://github.com/aptos-labs/serde-reflection", rev = "839aed62a20ddccf043c08961cfe74875741ccba" }
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "839aed62a20ddccf043c08961cfe74875741ccba" }
serde-generate = { git = "https://github.com/aptos-labs/serde-reflection", rev = "f2b5fb605dee0d2f8fd42a6d7faca177e524ea14" }
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "f2b5fb605dee0d2f8fd42a6d7faca177e524ea14" }
serde_yaml = "0.8.24"
shadow-rs = "0.16.2"
smallvec = "1.8.0"
Expand Down Expand Up @@ -747,7 +745,7 @@ debug-assertions = true
debug = true

[patch.crates-io]
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "839aed62a20ddccf043c08961cfe74875741ccba" }
serde-reflection = { git = "https://github.com/aptos-labs/serde-reflection", rev = "f2b5fb605dee0d2f8fd42a6d7faca177e524ea14" }
merlin = { git = "https://github.com/aptos-labs/merlin" }
x25519-dalek = { git = "https://github.com/aptos-labs/x25519-dalek", branch = "zeroize_v1" }
# More context here: https://github.com/weiznich/diesel_async/pull/121.
Expand Down
4 changes: 2 additions & 2 deletions crates/aptos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ move-unit-test = { workspace = true, features = [ "debugging" ] }
move-vm-runtime = { workspace = true, features = [ "testing" ] }
once_cell = { workspace = true }
poem = { workspace = true }
processor = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "2d5cb211a89a8705674e9e1e741c841dd899c558" }
processor = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "2eea8d1d71ea195558d571202d3003071af8766b" }
rand = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true }
self_update = { version = "0.38.0", features = ["archive-zip", "compression-zip-deflate"] }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "2d5cb211a89a8705674e9e1e741c841dd899c558" }
server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processors.git", rev = "2eea8d1d71ea195558d571202d3003071af8766b" }
tempfile = { workspace = true }
termcolor = { workspace = true }
thiserror = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions testsuite/generate-format/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,8 @@ pub fn get_registry() -> Result<Registry> {
// output types
tracer.trace_type::<CoinStoreResource>(&samples)?;

// aliases within StructTag
tracer.ignore_aliases("StructTag", "type_args", &["type_params"])?;

tracer.registry()
}
4 changes: 4 additions & 0 deletions testsuite/generate-format/src/aptos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@ pub fn get_registry() -> Result<Registry> {
tracer.trace_type::<transaction::authenticator::AnyPublicKey>(&samples)?;
tracer.trace_type::<transaction::authenticator::AnySignature>(&samples)?;
tracer.trace_type::<write_set::WriteOp>(&samples)?;

// aliases within StructTag
tracer.ignore_aliases("StructTag", "type_args", &["type_params"])?;

tracer.registry()
}
3 changes: 3 additions & 0 deletions testsuite/generate-format/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@ pub fn get_registry() -> Result<Registry> {
tracer.trace_type::<aptos_consensus_types::block_retrieval::BlockRetrievalStatus>(&samples)?;
tracer.trace_type::<aptos_consensus_types::common::Payload>(&samples)?;

// aliases within StructTag
tracer.ignore_aliases("StructTag", "type_args", &["type_params"])?;

tracer.registry()
}
4 changes: 4 additions & 0 deletions testsuite/generate-format/src/move_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ pub fn get_registry() -> Result<Registry> {
// 2. Trace the main entry point(s) + every enum separately.
tracer.trace_type::<transaction::EntryABI>(&samples)?;
tracer.trace_type::<language_storage::TypeTag>(&samples)?;

// aliases within StructTag
tracer.ignore_aliases("StructTag", "type_args", &["type_params"])?;

tracer.registry()
}
2 changes: 1 addition & 1 deletion third_party/move/move-core/types/src/language_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub struct StructTag {
pub module: Identifier,
pub name: Identifier,
// alias for compatibility with old json serialized data.
#[serde(rename = "type_args")]
#[serde(rename = "type_args", alias = "type_params")]
pub type_params: Vec<TypeTag>,
}

Expand Down

0 comments on commit c6011f1

Please sign in to comment.