Skip to content

Conversation

ArchanaArige
Copy link
Contributor

What this PR does / why we need it:

Test the Explorer compatibility with Hyperledger Fabric v2.4.7.
The functionality which fetches the list of orgs, is also fetching an empty org. This is due to the reason that the first transaction of type "config" is not associated with any creator organisation. So, while saving this transaction to the postgres, the field creator_msp_id is blank.

Which issue(s) this PR fixes:

Fixes #372

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation, usage docs, etc.:


@ArchanaArige ArchanaArige requested a review from a team as a code owner April 3, 2023 07:36
@@ -701,7 +701,7 @@ export class MetricService {
getTxByOrgs(network_name: any, channel_genesis_hash: any) {
const sqlPerOrg = ` select count(creator_msp_id), creator_msp_id
from transactions
where channel_genesis_hash =$1 and network_name=$2
where Trim(creator_msp_id) > '' and channel_genesis_hash =$1 and network_name=$2
Copy link
Contributor

Choose a reason for hiding this comment

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

[nitpick]: how about using not equal operator <>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes we can use not equal but in order to handle the case trailing spaces along with empty fields used "TRIM" function.

@ArchanaArige ArchanaArige merged commit 8c5220e into hyperledger-labs:main May 4, 2023
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.

Empty org is being displayed while fetching the list of orgs
2 participants