@@ -137,7 +137,7 @@ pub struct MsgInstantiateContract {
137
137
pub sender : AccountId ,
138
138
139
139
/// Admin is an optional address that can execute migrations
140
- pub admin : AccountId ,
140
+ pub admin : Option < AccountId > ,
141
141
142
142
/// CodeID is the reference to the stored WASM code
143
143
pub code_id : u64 ,
@@ -174,9 +174,14 @@ impl TryFrom<proto::cosmwasm::wasm::v1beta1::MsgInstantiateContract> for MsgInst
174
174
} else {
175
175
Some ( proto. label )
176
176
} ;
177
+ let admin = if proto. admin . is_empty ( ) {
178
+ None
179
+ } else {
180
+ Some ( proto. admin . parse ( ) )
181
+ } ;
177
182
Ok ( MsgInstantiateContract {
178
183
sender : proto. sender . parse ( ) ?,
179
- admin : proto . admin . parse ( ) ?,
184
+ admin : admin. transpose ( ) ?,
180
185
code_id : proto. code_id ,
181
186
label,
182
187
init_msg : proto. init_msg ,
@@ -193,7 +198,7 @@ impl From<MsgInstantiateContract> for proto::cosmwasm::wasm::v1beta1::MsgInstant
193
198
fn from ( msg : MsgInstantiateContract ) -> proto:: cosmwasm:: wasm:: v1beta1:: MsgInstantiateContract {
194
199
proto:: cosmwasm:: wasm:: v1beta1:: MsgInstantiateContract {
195
200
sender : msg. sender . to_string ( ) ,
196
- admin : msg. admin . to_string ( ) ,
201
+ admin : msg. admin . map ( |admin| admin . to_string ( ) ) . unwrap_or_default ( ) ,
197
202
code_id : msg. code_id ,
198
203
label : msg. label . unwrap_or_default ( ) ,
199
204
init_msg : msg. init_msg ,
0 commit comments