Skip to content

Commit f540a53

Browse files
committed
Change Inputs fields of transaction commands to public.
1 parent 402b5fc commit f540a53

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/runtime.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use crate::cryptography::PublicAddress;
1111
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
1212
pub struct TransferInput {
1313
/// Recipient of the transfer
14-
recipient: PublicAddress,
14+
pub recipient: PublicAddress,
1515

1616
/// The amount to transfer
17-
amount: u64
17+
pub amount: u64
1818
}
1919

2020
impl Serializable for TransferInput {}
@@ -23,10 +23,10 @@ impl Deserializable for TransferInput {}
2323
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
2424
pub struct DeployInput {
2525
/// Smart contract in format of WASM bytecode
26-
contract: Vec<u8>,
26+
pub contract: Vec<u8>,
2727

2828
/// Version of Contract Binary Interface
29-
cbi_version: u32
29+
pub cbi_version: u32
3030
}
3131

3232
impl Serializable for DeployInput {}
@@ -35,17 +35,17 @@ impl Deserializable for DeployInput {}
3535
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
3636
pub struct CallInput {
3737
/// The address of the target contract
38-
target: PublicAddress,
38+
pub target: PublicAddress,
3939

4040
/// The method to be invoked
41-
method: String,
41+
pub method: String,
4242

4343
/// The arguments supplied to the invoked method. It is a list of serialized method arguments (see [Serializable])
44-
arguments: Option<Vec<Vec<u8>>>,
44+
pub arguments: Option<Vec<Vec<u8>>>,
4545

4646
/// The amount sent to the target contract. The invoked contract can check the received amount
4747
/// by host function `amount()` according to the CBI.
48-
amount: Option<u64>
48+
pub amount: Option<u64>
4949
}
5050

5151
impl Serializable for CallInput {}
@@ -55,7 +55,7 @@ impl Deserializable for CallInput {}
5555
pub struct CreatePoolInput {
5656
/// Commission rate (in unit of percentage) is the portion that
5757
/// the owners of its delegated stakes should pay from the reward in an epoch transaction.
58-
commission_rate: u8
58+
pub commission_rate: u8
5959
}
6060

6161
impl Serializable for CreatePoolInput {}
@@ -65,7 +65,7 @@ impl Deserializable for CreatePoolInput {}
6565
pub struct SetPoolSettingsInput {
6666
/// Commission rate (in unit of percentage) is the portion that
6767
/// the owners of its delegated stakes should pay from the reward in an epoch transaction.
68-
commission_rate: u8,
68+
pub commission_rate: u8,
6969
}
7070

7171
impl Serializable for SetPoolSettingsInput {}
@@ -74,14 +74,14 @@ impl Deserializable for SetPoolSettingsInput {}
7474
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
7575
pub struct CreateDepositInput {
7676
/// The address of operator of the target pool
77-
operator: PublicAddress,
77+
pub operator: PublicAddress,
7878

7979
/// The deposit amount
80-
balance: u64,
80+
pub balance: u64,
8181

8282
/// Flag to indicate whether the received reward in epoch transaction should be automatically
8383
/// staked to the pool
84-
auto_stake_rewards: bool,
84+
pub auto_stake_rewards: bool,
8585
}
8686

8787
impl Serializable for CreateDepositInput {}
@@ -90,11 +90,11 @@ impl Deserializable for CreateDepositInput {}
9090
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
9191
pub struct SetDepositSettingsInput {
9292
/// The address of operator of the target pool
93-
operator: PublicAddress,
93+
pub operator: PublicAddress,
9494

9595
/// Flag to indicate whether the received reward in epoch transaction should be automatically
9696
/// staked to the pool
97-
auto_stake_rewards: bool,
97+
pub auto_stake_rewards: bool,
9898
}
9999

100100
impl Serializable for SetDepositSettingsInput {}
@@ -103,10 +103,10 @@ impl Deserializable for SetDepositSettingsInput {}
103103
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
104104
pub struct TopUpDepositInput {
105105
/// The address of operator of the target pool
106-
operator: PublicAddress,
106+
pub operator: PublicAddress,
107107

108108
/// The amount added to Deposit's Balance
109-
amount: u64,
109+
pub amount: u64,
110110
}
111111

112112
impl Serializable for TopUpDepositInput {}
@@ -115,12 +115,12 @@ impl Deserializable for TopUpDepositInput {}
115115
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
116116
pub struct WithdrawDepositInput {
117117
/// The address of operator of the target pool
118-
operator: PublicAddress,
118+
pub operator: PublicAddress,
119119

120120
/// The amount of deposits that the stake owner wants to withdraw. The prefix 'max'
121121
/// is denoted here because the actual withdrawal amount can be less than
122122
/// the wanted amount.
123-
max_amount: u64,
123+
pub max_amount: u64,
124124
}
125125

126126
impl Serializable for WithdrawDepositInput {}
@@ -129,12 +129,12 @@ impl Deserializable for WithdrawDepositInput {}
129129
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
130130
pub struct StakeDepositInput {
131131
/// The address of operator of the target pool
132-
operator: PublicAddress,
132+
pub operator: PublicAddress,
133133

134134
/// The amount of stakes that the stake owner wants to stake to the target pool.
135135
/// The prefix 'max' is denoted here because the actual amount to be staked
136136
/// can be less than the wanted amount.
137-
max_amount: u64,
137+
pub max_amount: u64,
138138
}
139139

140140
impl Serializable for StakeDepositInput {}
@@ -143,12 +143,12 @@ impl Deserializable for StakeDepositInput {}
143143
#[derive(Debug, Clone, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
144144
pub struct UnstakeDepositInput {
145145
/// The address of operator of the target pool
146-
operator: PublicAddress,
146+
pub operator: PublicAddress,
147147

148148
/// The amount of stakes that the stake owner wants to remove from the target pool.
149149
/// The prefix 'max' is denoted here because the actual amount to be removed
150150
/// can be less than the wanted amount.
151-
max_amount: u64,
151+
pub max_amount: u64,
152152
}
153153

154154
impl Serializable for UnstakeDepositInput {}

0 commit comments

Comments
 (0)