Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ingress-egress-tracker): remove unnecessary fields #4425

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

acdibble
Copy link
Contributor

Pull Request

Closes: PRO-xxx

Checklist

Please conduct a thorough self-review before opening the PR.

  • I am confident that the code works.
  • I have updated documentation where appropriate.

Summary

Please include a succinct description of the purpose and content of the PR. What problem does it solve, and how? Link issues, discussions, other PRs, and anything else that will help the reviewer.

@acdibble acdibble requested a review from a team as a code owner January 17, 2024 15:19
@acdibble acdibble requested review from jerryafr and zoheb391 and removed request for a team January 17, 2024 15:19
destination: String,
value: f64,
value: u64,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed this to return sats because that's our practice across the board

Comment on lines -29 to -31
const EVENT_BUFFER_SIZE: usize = 1024;
let (witness_sender, _) =
tokio::sync::broadcast::channel::<state_chain_runtime::RuntimeCall>(EVENT_BUFFER_SIZE);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer need to multicast the witnessing calls to different websockets so i removed the channel logic

let mut map = serializer.serialize_map(Some(3))?;
map.serialize_entry("confirmations", &self.confirmations)?;
map.serialize_entry("tx_hash", &self.tx_hash)?;
map.serialize_entry("value", &format!("0x{:x}", self.value))?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hex encode the u64

enum TransactionId {
Bitcoin { hash: String },
Ethereum { signature: SchnorrVerificationComponents },
Polkadot { signature: String },
}

#[derive(Serialize)]
#[serde(tag = "type", rename_all = "snake_case")]
#[serde(untagged)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tag is part of the key in redis so it doesn't need to be serialized

@@ -15,46 +15,22 @@ use serde::Serialize;
use utilities::rpc::NumberOrHex;

#[derive(Serialize)]
pub struct WitnessAsset {
pub chain: ForeignChain,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the chain is part of the key in redis so it doesn't need to be serialized


#[derive(Serialize)]
#[serde(tag = "deposit_chain")]
#[serde(untagged)]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this tag is part of the key in redis so it doesn't need to be serialized

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a2bf65c) 72% compared to head (dc7578a) 72%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4425   +/-   ##
=====================================
- Coverage     72%     72%   -0%     
=====================================
  Files        396     396           
  Lines      67426   67410   -16     
  Branches   67426   67410   -16     
=====================================
- Hits       48582   48534   -48     
- Misses     16400   16434   +34     
+ Partials    2444    2442    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kylezs kylezs requested a review from msgmaxim January 17, 2024 15:28
@acdibble acdibble merged commit 08a1a47 into main Jan 17, 2024
43 checks passed
@acdibble acdibble deleted the refactor/remove-fields branch January 17, 2024 17:37
syan095 added a commit that referenced this pull request Jan 19, 2024
…itness-swap

* origin/main: (24 commits)
  fix: restore correct restriction on redemption expiry (PRO-1072)
  Feat/migrate-to-polkadot-sdk-repo (#4361)
  chore: fix RUSTSEC-2024-0003 (#4426)
  Feat: decouple CFE from SC events (#4382)
  chore: add docker tag prefix to `chainflip-ingress-egress-tacker` 🏷️ (#4427)
  refactor/PRO-1101: rid of swapping minimum swap amount (#4419)
  refactor(ingress-egress-tracker): remove unnecessary fields (#4425)
  Improved the retry queue storage (#4420)
  fix: bump spec version command only bumps when necessary (#4422)
  refactor: use yargs for all try_runtime_command options (#4423)
  fix: await finalisation before starting broker (#4412)
  chore: debug logs to see get_raw_txs query (#4413)
  doc: correct env vars (#4416)
  fix: pool_orders rpc filters empty orders (PRO-1039) (#4377)
  Produce an event in case the swap yields a zero egress amount (#4410)
  fix: don't have conflicting redis port with localnet (#4415)
  Ability to specify output for the subcommands, other than `/dev/null` (#4411)
  chore: increase limit on max number of bitcoin payloads in a ceremony to theoretical maximum (#4396)
  refactor(ingress-egress-tracker): configurable expiry times [WEB-761] (#4406)
  fix: use existing script for upgrade job (#4403)
  ...

# Conflicts:
#	Cargo.lock
#	state-chain/primitives/Cargo.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants