Skip to content

Commit

Permalink
Relayer: Send coreum originated token from XRPL to coreum integration (
Browse files Browse the repository at this point in the history
…#52)

* Add contract client integration tests
* Implement relayer integration
* Add asset FT error handling
* Merge tests send relayer integration tests
  • Loading branch information
dzmitryhil authored Nov 29, 2023
1 parent 78f24b3 commit 9cf7c67
Show file tree
Hide file tree
Showing 14 changed files with 1,022 additions and 292 deletions.
7 changes: 4 additions & 3 deletions contract/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,11 @@ fn save_evidence(deps: DepsMut, sender: Addr, evidence: Evidence) -> CoreumResul
None => return Err(ContractError::TokenNotRegistered {}),
};

if threshold_reached {
let amount_to_send =
truncate_amount(token.sending_precision, token.decimals, amount)?;
// TODO(keyleu): add/update tests for it
// We build the amount_to_send here since it includes validation against zero amount after the truncation
let amount_to_send = truncate_amount(token.sending_precision, token.decimals, amount)?;

if threshold_reached {
// TODO(keyleu): for now we are SENDING back the entire amount but when fees are implemented this will not happen and part of the amount will be sent and funds will be collected
let send_msg = BankMsg::Send {
to_address: recipient.to_string(),
Expand Down
Loading

0 comments on commit 9cf7c67

Please sign in to comment.