Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make compatible proto chagne. #12016

Merged
merged 5 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions ecosystem/indexer-grpc/indexer-grpc-fullnode/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,29 +576,36 @@ pub fn convert_multi_key_signature(sig: &MultiKeySignature) -> transaction::Mult
}
}

#[allow(deprecated)]
fn convert_signature(signature: &Signature) -> transaction::AnySignature {
match signature {
Signature::Ed25519(s) => transaction::AnySignature {
r#type: transaction::any_signature::Type::Ed25519 as i32,
signature: Some(any_signature::Signature::Ed25519(Ed25519 {
signature: s.0.clone(),
signature_variant: Some(any_signature::SignatureVariant::Ed25519(Ed25519 {
signature: s.0.clone(),
})),
},
Signature::Secp256k1Ecdsa(s) => transaction::AnySignature {
r#type: transaction::any_signature::Type::Secp256k1Ecdsa as i32,
signature: Some(any_signature::Signature::Secp256k1Ecdsa(Secp256k1Ecdsa {
signature: s.0.clone(),
})),
signature: s.0.clone(),
signature_variant: Some(any_signature::SignatureVariant::Secp256k1Ecdsa(
Secp256k1Ecdsa {
signature: s.0.clone(),
},
)),
},
Signature::WebAuthn(s) => transaction::AnySignature {
r#type: transaction::any_signature::Type::Webauthn as i32,
signature: Some(any_signature::Signature::Webauthn(WebAuthn {
signature: s.0.clone(),
signature_variant: Some(any_signature::SignatureVariant::Webauthn(WebAuthn {
signature: s.0.clone(),
})),
},
Signature::ZkId(s) => transaction::AnySignature {
r#type: transaction::any_signature::Type::Zkid as i32,
signature: Some(any_signature::Signature::Zkid(ZkId {
signature: s.0.clone(),
signature_variant: Some(any_signature::SignatureVariant::Zkid(ZkId {
signature: s.0.clone(),
})),
},
Expand Down
15 changes: 10 additions & 5 deletions protos/proto/aptos/transaction/v1/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,16 @@ message AnySignature {

Type type = 1;

oneof signature {
Ed25519 ed25519 = 2;
Secp256k1Ecdsa secp256k1_ecdsa = 3;
WebAuthn webauthn = 4;
ZkId zkid = 5;
// Deprecated: use signature_variant instead.
// Note: >= 1.10, this field is deprecated.
bytes signature = 2 [deprecated = true];

// Support: >= 1.10.
oneof signature_variant {
Ed25519 ed25519 = 3;
Secp256k1Ecdsa secp256k1_ecdsa = 4;
WebAuthn webauthn = 5;
ZkId zkid = 6;
}
}

Expand Down
2 changes: 1 addition & 1 deletion protos/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aptos-protos"
version = "1.1.2"
version = "1.3.0"
authors = ["Aptos Labs <[email protected]>"]
description = "Code generated from Aptos protobuf definitions"
repository = "https://github.com/aptos-labs/aptos-core"
Expand Down
Loading
Loading