mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-30 03:31:56 +00:00
.circleci
.github
DOCKER
abci
behaviour
benchmarks
blockchain
cmd
config
consensus
crypto
docs
evidence
libs
lite
mempool
mock
networks
node
p2p
privval
proxy
rpc
scripts
state
store
test
tools
types
proto3
time
block.go
block_meta.go
block_test.go
canonical.go
encoding_helper.go
event_bus.go
event_bus_test.go
events.go
events_test.go
evidence.go
evidence_test.go
genesis.go
genesis_test.go
keys.go
params.go
params_test.go
part_set.go
part_set_test.go
priv_validator.go
proposal.go
proposal_test.go
proto3_test.go
protobuf.go
protobuf_test.go
results.go
results_test.go
signable.go
signed_msg_type.go
test_util.go
tx.go
tx_test.go
validation.go
validator.go
validator_set.go
validator_set_test.go
vote.go
vote_set.go
vote_set_test.go
vote_test.go
wire.go
version
.editorconfig
.gitignore
.golangci.yml
CHANGELOG.md
CHANGELOG_PENDING.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
Makefile
PHILOSOPHY.md
README.md
ROADMAP.md
SECURITY.md
UPGRADING.md
Vagrantfile
appveyor.yml
codecov.yml
docker-compose.yml
go.mod
go.sum
* crypto/merkle: Remove byter in favor of plain byte slices This PR is fully backwards compatible in terms of function output! (The Go API differs though) The only test case changes was to refactor it to be table driven. * Update godocs per review comments
15 lines
343 B
Go
15 lines
343 B
Go
package types
|
|
|
|
import (
|
|
cmn "github.com/tendermint/tendermint/libs/common"
|
|
)
|
|
|
|
// cdcEncode returns nil if the input is nil, otherwise returns
|
|
// cdc.MustMarshalBinaryBare(item)
|
|
func cdcEncode(item interface{}) []byte {
|
|
if item != nil && !cmn.IsTypedNil(item) && !cmn.IsEmpty(item) {
|
|
return cdc.MustMarshalBinaryBare(item)
|
|
}
|
|
return nil
|
|
}
|