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

Use custom gomega matcher for protobuf equality #4966

Merged
merged 1 commit into from
Aug 30, 2024

Commits on Aug 29, 2024

  1. Use custom gomega matcher for protobuf equality

    The standard gomega Equal matcher is not reliable when used with
    protobuf messages since they can be logically equal while containing
    different implementation field values. This change implements a custom
    ProtoEqual matcher that uses proto.Equal for reliable equality checks.
    
    A failed match produces output similar to the following:
    
    ```
    [FAILED] Expected
            ChaincodeMessage{
                    type:  TRANSACTION
                    payload:  "\n\x04arg1\n\x04arg2"
                    txid:  "tx-id"
                    proposal:  {
                            proposal_bytes:  "signed-proposal-bytes"
                            signature:  "signature"
                    }
                    channel_id:  "channel-id"
            }
      to equal
            SignedProposal{
                    proposal_bytes:  "signed-proposal-bytes"
                    signature:  "signature"
            }
    ```
    
    Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
    bestbeforetoday committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    baf360f View commit details
    Browse the repository at this point in the history