Skip to content

Commit

Permalink
add serde to script function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Nov 25, 2024
1 parent 8058976 commit 8b20710
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ type Bytes = Vec<u8>;
/// pub fn decode(&Script) -> Option<ScriptCall> { .. }
/// }
/// ```
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
#[cfg_attr(feature = "fuzzing", proptest(no_params))]

//////// 0L ////////
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, serde::Deserialize, serde::Serialize)]
// #[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
// #[cfg_attr(feature = "fuzzing", proptest(no_params))]
pub enum ScriptCall {
/// # Summary
/// Adds a zero `Currency` balance to the sending `account`. This will enable `account` to
Expand Down Expand Up @@ -1441,9 +1443,8 @@ pub enum ScriptCall {
/// pub fn decode(&TransactionPayload) -> Option<ScriptFunctionCall> { .. }
/// }
/// ```
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
#[cfg_attr(feature = "fuzzing", proptest(no_params))]
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, serde::Deserialize, serde::Serialize)]

pub enum ScriptFunctionCall {
/// # Summary
/// Adds a zero `Currency` balance to the sending `account`. This will enable `account` to
Expand Down Expand Up @@ -4352,7 +4353,7 @@ pub fn encode_create_acc_user_script_function(
],
))
}

#[allow(clippy::too_many_arguments)]
pub fn encode_create_acc_val_script_function(
challenge: Vec<u8>,
solution: Vec<u8>,
Expand Down Expand Up @@ -5769,6 +5770,7 @@ pub fn encode_rotate_shared_ed25519_public_key_script_function(
/// | `Errors::INVALID_ARGUMENT` | `SlidingNonce::ENONCE_TOO_NEW` | The `sliding_nonce` is too far in the future. |
/// | `Errors::INVALID_ARGUMENT` | `SlidingNonce::ENONCE_ALREADY_RECORDED` | The `sliding_nonce` has been previously recorded. |
/// | `Errors::REQUIRES_ADDRESS` | `CoreAddresses::EDIEM_ROOT` | `account` is not the Diem Root account. |
#[allow(clippy::too_many_arguments)]
pub fn encode_set_gas_constants_script_function(
sliding_nonce: u64,
global_memory_per_byte_cost: u64,
Expand Down
7 changes: 5 additions & 2 deletions compatibility/src/sdk/v5_2_0_transaction_script_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ type Bytes = Vec<u8>;
/// pub fn decode(&Script) -> Option<ScriptCall> { .. }
/// }
/// ```
#[derive(Clone, Debug, PartialEq, PartialOrd)]

//////// 0L ////////
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, serde::Deserialize, serde::Serialize)]

// #[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
// #[cfg_attr(feature = "fuzzing", proptest(no_params))]
pub enum ScriptCall {
Expand Down Expand Up @@ -1441,7 +1444,7 @@ pub enum ScriptCall {
/// pub fn decode(&TransactionPayload) -> Option<ScriptFunctionCall> { .. }
/// }
/// ```
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, serde::Deserialize, serde::Serialize)]
// #[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
// #[cfg_attr(feature = "fuzzing", proptest(no_params))]
pub enum ScriptFunctionCall {
Expand Down
4 changes: 2 additions & 2 deletions compatibility/src/sdk/v6_libra_framework_sdk_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ type Bytes = Vec<u8>;
// explorer and data warehouse
//////// end ////////
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
#[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
#[cfg_attr(feature = "fuzzing", proptest(no_params))]
// #[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
// #[cfg_attr(feature = "fuzzing", proptest(no_params))]
pub enum EntryFunctionCall {
/// Offers rotation capability on behalf of `account` to the account at address `recipient_address`.
/// An account can delegate its rotation capability to only one other address at one time. If the account
Expand Down

0 comments on commit 8b20710

Please sign in to comment.