Skip to content

Commit

Permalink
review: exclude custom instructions from schema types!
Browse files Browse the repository at this point in the history
Signed-off-by: Shunkichi Sato <[email protected]>
  • Loading branch information
s8sato committed Nov 8, 2024
1 parent 814b23b commit f54d3d9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion crates/iroha_executor_data_model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ iroha_data_model.workspace = true
iroha_schema.workspace = true

derive_more = { workspace = true, features = ["constructor", "from"] }
parity-scale-codec.workspace = true
serde.workspace = true
serde_json.workspace = true
9 changes: 4 additions & 5 deletions crates/iroha_executor_data_model/src/isi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use iroha_data_model::{
prelude::{Json, *},
};
use iroha_schema::IntoSchema;
use parity_scale_codec::{Decode, Encode};
use serde::{Deserialize, Serialize};

use super::*;
Expand Down Expand Up @@ -57,7 +56,7 @@ pub mod multisig {
use super::*;

/// Multisig-related instructions
#[derive(Debug, Clone, Encode, Decode, Serialize, Deserialize, IntoSchema, From)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoSchema, From)]
pub enum MultisigInstructionBox {
/// Register a multisig account, which is a prerequisite of multisig transactions
Register(MultisigRegister),
Expand All @@ -68,7 +67,7 @@ pub mod multisig {
}

/// Register a multisig account, which is a prerequisite of multisig transactions
#[derive(Debug, Clone, Encode, Decode, Serialize, Deserialize, IntoSchema, Constructor)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoSchema, Constructor)]
pub struct MultisigRegister {
/// Multisig account to be registered
/// <div class="warning">
Expand All @@ -95,7 +94,7 @@ pub mod multisig {
pub const DEFAULT_MULTISIG_TTL_MS: u64 = 60 * 60 * 1_000; // 1 hour

/// Propose a multisig transaction and initialize approvals with the proposer's one
#[derive(Debug, Clone, Encode, Decode, Serialize, Deserialize, IntoSchema, Constructor)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoSchema, Constructor)]
pub struct MultisigPropose {
/// Multisig account to propose
pub account: AccountId,
Expand All @@ -104,7 +103,7 @@ pub mod multisig {
}

/// Approve a certain multisig transaction
#[derive(Debug, Clone, Encode, Decode, Serialize, Deserialize, IntoSchema, Constructor)]
#[derive(Debug, Clone, Serialize, Deserialize, IntoSchema, Constructor)]
pub struct MultisigApprove {
/// Multisig account to approve
pub account: AccountId,
Expand Down
12 changes: 5 additions & 7 deletions crates/iroha_schema_gen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,6 @@ types!(
MintabilityError,
Mintable,
Mismatch<AssetType>,
MultisigInstructionBox,
MultisigRegister,
MultisigPropose,
MultisigApprove,
Name,
NewAccount,
NewAssetDefinition,
Expand Down Expand Up @@ -549,9 +545,6 @@ pub mod complete_data_model {
},
Level,
};
pub use iroha_executor_data_model::isi::multisig::{
MultisigApprove, MultisigInstructionBox, MultisigPropose, MultisigRegister,
};
pub use iroha_genesis::{GenesisWasmAction, GenesisWasmTrigger, WasmPath};
pub use iroha_primitives::{const_vec::ConstVec, conststr::ConstString, json::Json};
pub use iroha_schema::Compact;
Expand Down Expand Up @@ -631,6 +624,11 @@ mod tests {
);
insert_into_test_map!(iroha_executor_data_model::permission::executor::CanUpgradeExecutor);

insert_into_test_map!(iroha_executor_data_model::isi::multisig::MultisigInstructionBox);
insert_into_test_map!(iroha_executor_data_model::isi::multisig::MultisigRegister);
insert_into_test_map!(iroha_executor_data_model::isi::multisig::MultisigPropose);
insert_into_test_map!(iroha_executor_data_model::isi::multisig::MultisigApprove);

map
}

Expand Down

0 comments on commit f54d3d9

Please sign in to comment.