@@ -27,8 +27,8 @@ pub const CHANNEL_REVERSE_STATE: Map<(&str, &str), ChannelState> =
27
27
Map :: new ( "channel_reverse_state" ) ;
28
28
29
29
/// Reverse channel state is used when LOCAL chain initiates ibc transfer to remote chain
30
- pub const CHANNEL_FORWARD_STATE : Map < ( & str , & str ) , ChannelState > =
31
- Map :: new ( "channel_forward_state" ) ;
30
+ // pub const CHANNEL_FORWARD_STATE: Map<(&str, &str), ChannelState> =
31
+ // Map::new("channel_forward_state");
32
32
33
33
/// Every cw20 contract we allow to be sent is stored here, possibly with a gas_limit
34
34
pub const ALLOW_LIST : Map < & Addr , AllowInfo > = Map :: new ( "allow_list" ) ;
@@ -143,8 +143,7 @@ pub fn increase_channel_balance(
143
143
denom : & str , // should be ibc denom
144
144
amount : Uint128 ,
145
145
) -> Result < ( ) , ContractError > {
146
- let state = CHANNEL_REVERSE_STATE ;
147
- state. update ( storage, ( channel, denom) , |orig| -> StdResult < _ > {
146
+ CHANNEL_REVERSE_STATE . update ( storage, ( channel, denom) , |orig| -> StdResult < _ > {
148
147
let mut state = orig. unwrap_or_default ( ) ;
149
148
state. outstanding += amount;
150
149
state. total_sent += amount;
@@ -159,8 +158,7 @@ pub fn reduce_channel_balance(
159
158
denom : & str , // should be ibc denom
160
159
amount : Uint128 ,
161
160
) -> Result < ( ) , ContractError > {
162
- let state = CHANNEL_REVERSE_STATE ;
163
- state. update (
161
+ CHANNEL_REVERSE_STATE . update (
164
162
storage,
165
163
( channel, denom) ,
166
164
|orig| -> Result < _ , ContractError > {
@@ -190,8 +188,7 @@ pub fn override_channel_balance(
190
188
outstanding : Uint128 ,
191
189
total_sent : Option < Uint128 > ,
192
190
) -> Result < ( ) , ContractError > {
193
- let state = CHANNEL_REVERSE_STATE ;
194
- state. update ( storage, ( channel, denom) , |orig| -> StdResult < _ > {
191
+ CHANNEL_REVERSE_STATE . update ( storage, ( channel, denom) , |orig| -> StdResult < _ > {
195
192
let mut state = orig. unwrap_or_default ( ) ;
196
193
state. outstanding = outstanding;
197
194
if let Some ( total_sent) = total_sent {
@@ -209,13 +206,8 @@ pub fn undo_reduce_channel_balance(
209
206
channel : & str ,
210
207
denom : & str ,
211
208
amount : Uint128 ,
212
- forward : bool ,
213
209
) -> Result < ( ) , ContractError > {
214
- let mut state = CHANNEL_REVERSE_STATE ;
215
- if forward {
216
- state = CHANNEL_FORWARD_STATE ;
217
- }
218
- state. update ( storage, ( channel, denom) , |orig| -> StdResult < _ > {
210
+ CHANNEL_REVERSE_STATE . update ( storage, ( channel, denom) , |orig| -> StdResult < _ > {
219
211
let mut state = orig. unwrap_or_default ( ) ;
220
212
state. outstanding += amount;
221
213
Ok ( state)
0 commit comments