Skip to content

Conversation

@incrypto32
Copy link
Member

No description provided.

let other_str = String::from_utf8(other.id.clone()).map_err(IdCompareError::InvalidUtf8)?;
Ok(self_str.cmp(&other_str))
}
IdType::Bytes => Ok(self.id.cmp(&other.id)),
Copy link
Contributor

Choose a reason for hiding this comment

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

The same check could be used for the string too. We don't care what is the content of the ID, only if it's equal to the other one. And I would go so far to say that it holds for Int8 case too as we don't mind if the order is ascending or descending, we only need the cmp() to be able to detect equality and have a consistent ordering otherwise which is achieved with byte comparison. So I would keep the Ord a it is and only change the type of the id field in EntityDataExt.

}

#[test]
fn read_range_pool_created_test() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice to add a test case!

@incrypto32 incrypto32 force-pushed the krishna/sgc-multiple-sg-sources-fix branch from 0d72898 to ad34735 Compare January 9, 2025 11:56
@incrypto32 incrypto32 marked this pull request as ready for review January 9, 2025 12:13
@incrypto32 incrypto32 added this to the Subgraph Composition milestone Jan 9, 2025
fn compare_entity_data_ext(a: &EntityDataExt, b: &EntityDataExt) -> std::cmp::Ordering {
a.block_number
.cmp(&b.block_number)
.then_with(|| a.entity.cmp(&b.entity))
Copy link
Contributor

Choose a reason for hiding this comment

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

elegant!

@incrypto32 incrypto32 force-pushed the krishna/sgc-multiple-sg-sources-fix branch from ad34735 to 748ff48 Compare January 9, 2025 12:22
@incrypto32 incrypto32 changed the base branch from krishna/sgc-multiple-sg-sources to zoran/subgraph-composition-rework-vid-wrap2 January 9, 2025 12:22
@zorancv zorancv force-pushed the zoran/subgraph-composition-rework-vid-wrap2 branch 13 times, most recently from 14671db to 640e7d1 Compare January 21, 2025 15:24
@incrypto32 incrypto32 self-assigned this Jan 28, 2025
@incrypto32 incrypto32 force-pushed the krishna/sgc-multiple-sg-sources-fix branch 2 times, most recently from 06edc2b to f38680e Compare January 28, 2025 12:08
@incrypto32 incrypto32 changed the base branch from zoran/subgraph-composition-rework-vid-wrap2 to zoran/subgraph-composition-spec-version January 28, 2025 12:11
@zorancv zorancv force-pushed the zoran/subgraph-composition-spec-version branch 4 times, most recently from 097a772 to d8bea9d Compare January 28, 2025 22:10
@zorancv zorancv force-pushed the zoran/subgraph-composition-spec-version branch 5 times, most recently from 3d25869 to 6a28007 Compare January 31, 2025 07:41
@incrypto32 incrypto32 force-pushed the krishna/sgc-multiple-sg-sources-fix branch from 197b18d to 2a45671 Compare January 31, 2025 13:56
@incrypto32 incrypto32 force-pushed the zoran/subgraph-composition-spec-version branch from e5d997b to c8d8103 Compare January 31, 2025 14:22
@incrypto32 incrypto32 force-pushed the krishna/sgc-multiple-sg-sources-fix branch from 2a45671 to e28ab16 Compare January 31, 2025 14:41
@zorancv zorancv force-pushed the zoran/subgraph-composition-spec-version branch from c8d8103 to a6b7647 Compare February 2, 2025 10:09
@incrypto32 incrypto32 force-pushed the zoran/subgraph-composition-spec-version branch from a6b7647 to 9fa915b Compare February 3, 2025 09:12
@incrypto32 incrypto32 force-pushed the krishna/sgc-multiple-sg-sources-fix branch from e28ab16 to 4a290bf Compare February 3, 2025 09:15
@incrypto32 incrypto32 force-pushed the krishna/sgc-multiple-sg-sources-fix branch 2 times, most recently from c82c6cf to 432ba56 Compare February 3, 2025 11:10
@incrypto32 incrypto32 closed this Feb 25, 2025
@incrypto32 incrypto32 deleted the krishna/sgc-multiple-sg-sources-fix branch October 13, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants