hyperledger-archives / sawtooth-sdk-go

https://wiki.hyperledger.org/display/sawtooth
Apache License 2.0
28 stars 40 forks source link

Fix finding the handler #15

Closed RealDeanZhao closed 5 years ago

RealDeanZhao commented 5 years ago

Comparing to the Javascript SDK, we should not breaking the loop when the family name not match.

let handler = this._handlers.find(
            (candidate) =>
              candidate.transactionFamilyName === txnHeader.familyName &&
              candidate.versions.includes(txnHeader.familyVersion))
john-jam commented 5 years ago

If we can register some handlers with the same name and a different version like this:

You should modify the line 135 in the processor/worker.go too. You can see my commit on sawtooth-core (https://github.com/hyperledger/sawtooth-core/commit/56ab89faea2082a1820e22e89c8a18e9f3418b46) which is now obsolete since the go-sdk was removed in the core. It would be helpful if this PR could be merged soon :)

RealDeanZhao commented 5 years ago

@john-jam Thanks, I updated the code.

boydjohnson commented 5 years ago

@rberg2 Can you add @RealDeanZhao to the whitelist?

agunde406 commented 5 years ago

@RealDeanZhao can you rebase this pr to pick up some fixes that went in.

RealDeanZhao commented 5 years ago

@agunde406 Yes. It's done.