File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
contracts/ibc-callbacks/src Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -127,24 +127,26 @@ pub fn ibc_source_callback(
127
127
#[ entry_point]
128
128
pub fn ibc_destination_callback (
129
129
deps : DepsMut ,
130
- env : Env ,
130
+ _env : Env ,
131
131
msg : IbcDestinationCallbackMsg ,
132
132
) -> StdResult < IbcBasicResponse > {
133
133
let mut counts = load_stats ( deps. storage ) ?;
134
134
135
- // Assert that we have the funds we expect .
135
+ // Assert that the receiver has the funds in the message .
136
136
// This is just for testing purposes and to show that the funds are already available during
137
137
// the callback.
138
- for coin in & msg. funds {
139
- let balance = deps
140
- . querier
141
- . query_balance ( & env. contract . address , & coin. denom ) ?;
142
- ensure ! (
143
- balance. amount >= coin. amount,
144
- StdError :: generic_err( format!(
145
- "Didn't receive expected funds. expected: {coin}, have: {balance}"
146
- ) )
147
- ) ;
138
+ if let Some ( transfer) = & msg. transfer {
139
+ for coin in & transfer. funds {
140
+ let balance = deps
141
+ . querier
142
+ . query_balance ( & transfer. receiver , & coin. denom ) ?;
143
+ ensure ! (
144
+ balance. amount >= coin. amount,
145
+ StdError :: generic_err( format!(
146
+ "Didn't receive expected funds. expected: {coin}, have: {balance}"
147
+ ) )
148
+ ) ;
149
+ }
148
150
}
149
151
150
152
// save the receive
You can’t perform that action at this time.
0 commit comments