Merge pull request #185 from meshplus/fix/use-category-instead-of-type

fix(*): use category instead of type
This commit is contained in:
Treaser(Song) Lou 2020-10-09 20:03:27 +08:00 committed by GitHub
commit a6a62f47e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

2
go.mod
View File

@ -21,7 +21,7 @@ require (
github.com/magiconair/properties v1.8.1
github.com/meshplus/bitxhub-core v0.1.0-rc1.0.20200903124405-b2c62dd8db89
github.com/meshplus/bitxhub-kit v1.0.1-0.20200914065214-5161497a783c
github.com/meshplus/bitxhub-model v1.0.0-rc4.0.20200927025558-ef1daaa6a629
github.com/meshplus/bitxhub-model v1.0.0-rc4.0.20201009112846-79d2e6ddf10d
github.com/meshplus/go-lightp2p v0.0.0-20200817105923-6b3aee40fa54
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-multiaddr v0.2.2

2
go.sum
View File

@ -557,6 +557,8 @@ github.com/meshplus/bitxhub-model v1.0.0-rc3/go.mod h1:ZCctQIYTlE3vJ8Lhkrgs9bWwN
github.com/meshplus/bitxhub-model v1.0.0-rc4.0.20200514093243-7e8ae60d1c19/go.mod h1:QK8aACbxtZEA3Hk1BOCirW0uxMWLsMrLDpWz9FweIKM=
github.com/meshplus/bitxhub-model v1.0.0-rc4.0.20200927025558-ef1daaa6a629 h1:pIzGxvl8l0HtJGIoF0ZUvXB2zXEVqcPA4XcISGSSB+o=
github.com/meshplus/bitxhub-model v1.0.0-rc4.0.20200927025558-ef1daaa6a629/go.mod h1:QK8aACbxtZEA3Hk1BOCirW0uxMWLsMrLDpWz9FweIKM=
github.com/meshplus/bitxhub-model v1.0.0-rc4.0.20201009112846-79d2e6ddf10d h1:q4Vig+IVhBvARLyeOsFw8gAdor0ajiBl6lGch1N65sk=
github.com/meshplus/bitxhub-model v1.0.0-rc4.0.20201009112846-79d2e6ddf10d/go.mod h1:QK8aACbxtZEA3Hk1BOCirW0uxMWLsMrLDpWz9FweIKM=
github.com/meshplus/go-bitxhub-client v1.0.0-rc3/go.mod h1:FpiCyf6KhydcqthrHdvvPhbPIcD92b+Ju8T7WvQtSyM=
github.com/meshplus/go-lightp2p v0.0.0-20200817105923-6b3aee40fa54 h1:5Ip5AB7SxxQHg5SRtf2cCOI2wy1p75MQB12soPtPyf8=
github.com/meshplus/go-lightp2p v0.0.0-20200817105923-6b3aee40fa54/go.mod h1:G89UJaeqCQFxFdp8wzy1AdKfMtDEhpySau0pjDNeeaw=

View File

@ -144,7 +144,7 @@ func getAccount(tx *pb.Transaction) (string, error) {
if err := ibtp.Unmarshal(payload.Args[0].Value); err != nil {
return "", fmt.Errorf("unmarshal ibtp from tx :%w", err)
}
account := fmt.Sprintf("%s-%s-%d", ibtp.From, ibtp.To, ibtp.Type)
account := fmt.Sprintf("%s-%s-%d", ibtp.From, ibtp.To, ibtp.Category())
return account, nil
}
return tx.From.Hex(), nil