Skip to content

Commit

Permalink
fix: relayer fees in response (#351)
Browse files Browse the repository at this point in the history
* fix: relayer fees in response

* fix: response fee

---------

Co-authored-by: gcranju <[email protected]>
  • Loading branch information
gcranju and Itshyphen authored Aug 20, 2024
1 parent 79e682c commit fe47f25
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ module xcall::centralized_connection {
}
// this is safe because only package can call this other xcall will call other deployed instance
public(package) fun send_message(states:&mut Bag,connection_id:String,coin:Coin<SUI>,to:String,sn:u128,msg:vector<u8>,is_response:bool,ctx: &mut TxContext){
let fee = get_fee(states,connection_id, to, is_response);
let mut fee = 0;
if(!is_response){
fee = get_fee(states,connection_id, to, sn>0);
};
assert!(coin.value() >= fee, ENotEnoughFee);
let balance = coin.into_balance();
centralized_state::deposit(get_state_mut(states,connection_id),balance);
Expand Down

0 comments on commit fe47f25

Please sign in to comment.