@@ -14,8 +14,8 @@ pub struct Config<T: ValidatedKeyParams = FirstEntryKeyParams> {
1414 /// the vlad key and cid params
1515 vlad : VladParams < T > ,
1616
17- /// the entry key params
18- entrykey : OpParams ,
17+ /// First entry [OpParams]
18+ first_entry_params : OpParams ,
1919
2020 /// the pubkey params
2121 pubkey : OpParams ,
@@ -46,9 +46,11 @@ impl<T: ValidatedKeyParams> Config<T> {
4646 & self . first_lock
4747 }
4848
49- /// Get the entry key params
50- pub fn entrykey ( & self ) -> & OpParams {
51- & self . entrykey
49+ /// Get the (first) entry key params
50+ ///
51+ /// Because this is the Open Config, this will always be the first entry
52+ pub fn first_entry ( & self ) -> & OpParams {
53+ & self . first_entry_params
5254 }
5355
5456 /// Get the pubkey params
@@ -87,7 +89,12 @@ impl<T: ValidatedKeyParams> From<Config<T>> for Vec<OpParams> {
8789 // Gather all the operations from this config so we can store their values against their Cids
8890 let ( vlad_key_op, vlad_cid_op) : ( OpParams , OpParams ) = config. vlad . into ( ) ;
8991
90- let mut ops = vec ! [ vlad_key_op, vlad_cid_op, config. entrykey, config. pubkey] ;
92+ let mut ops = vec ! [
93+ vlad_key_op,
94+ vlad_cid_op,
95+ config. first_entry_params,
96+ config. pubkey,
97+ ] ;
9198 ops. extend ( config. additional_ops ) ;
9299 ops
93100 }
@@ -107,7 +114,7 @@ mod tests {
107114 // Create a Config with default type parameter (FirstEntryKeyParams)
108115 let config = Config :: builder ( )
109116 . vlad ( Default :: default ( ) )
110- . entrykey ( Default :: default ( ) )
117+ . first_entry_params ( Default :: default ( ) )
111118 . pubkey ( Default :: default ( ) )
112119 . lock ( Script :: Code ( Key :: default ( ) , "test lock" . to_string ( ) ) )
113120 . unlock ( Script :: Code ( Key :: default ( ) , "test unlock" . to_string ( ) ) )
@@ -126,7 +133,7 @@ mod tests {
126133 fn test_config_with_recovery_key_params ( ) {
127134 let config: Config < RecoveryKeyParams > = Config :: < RecoveryKeyParams > :: builder ( )
128135 . vlad ( VladParams :: < RecoveryKeyParams > :: builder ( ) . build ( ) )
129- . entrykey ( Default :: default ( ) )
136+ . first_entry_params ( Default :: default ( ) )
130137 . pubkey ( Default :: default ( ) )
131138 . lock ( Script :: Code ( Key :: default ( ) , "test lock" . to_string ( ) ) )
132139 . unlock ( Script :: Code ( Key :: default ( ) , "test unlock" . to_string ( ) ) )
@@ -150,7 +157,7 @@ mod tests {
150157 // Create Config and set VladParams
151158 let config = Config :: < FirstEntryKeyParams > :: builder ( )
152159 . vlad ( Default :: default ( ) )
153- . entrykey ( Default :: default ( ) )
160+ . first_entry_params ( Default :: default ( ) )
154161 . pubkey ( Default :: default ( ) )
155162 . lock ( Script :: Code ( Key :: default ( ) , "test lock" . to_string ( ) ) )
156163 . unlock ( Script :: Code ( Key :: default ( ) , "test unlock" . to_string ( ) ) )
@@ -177,7 +184,7 @@ mod tests {
177184 // Create a Config
178185 let config = Config :: builder ( )
179186 . vlad ( Default :: default ( ) )
180- . entrykey ( Default :: default ( ) )
187+ . first_entry_params ( Default :: default ( ) )
181188 . pubkey ( Default :: default ( ) )
182189 . lock ( Script :: Code ( Key :: default ( ) , "test lock" . to_string ( ) ) )
183190 . unlock ( Script :: Code ( Key :: default ( ) , "test unlock" . to_string ( ) ) )
@@ -199,7 +206,7 @@ mod tests {
199206 // Create a Config
200207 let config = Config :: builder ( )
201208 . vlad ( Default :: default ( ) )
202- . entrykey ( Default :: default ( ) )
209+ . first_entry_params ( Default :: default ( ) )
203210 . pubkey ( Default :: default ( ) )
204211 . lock ( Script :: Code ( Key :: default ( ) , "test lock" . to_string ( ) ) )
205212 . unlock ( Script :: Code ( Key :: default ( ) , "test unlock" . to_string ( ) ) )
@@ -219,7 +226,7 @@ mod tests {
219226 // This would be a compile error if we tried to use the wrong type
220227 let config = Config :: < FirstEntryKeyParams > :: builder ( )
221228 . vlad ( vlad_params)
222- . entrykey ( Default :: default ( ) )
229+ . first_entry_params ( Default :: default ( ) )
223230 . pubkey ( Default :: default ( ) )
224231 . lock ( Script :: Code ( Key :: default ( ) , "test lock" . to_string ( ) ) )
225232 . unlock ( Script :: Code ( Key :: default ( ) , "test unlock" . to_string ( ) ) )
0 commit comments