mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-27 03:31:42 +00:00
add 2 helper methods for building KVPair(s)
This commit is contained in:
19
types/kvpair.go
Normal file
19
types/kvpair.go
Normal file
@ -0,0 +1,19 @@
|
||||
package types
|
||||
|
||||
// KVPairInt is a helper method to build KV pair with an integer value.
|
||||
func KVPairInt(key string, val int64) *KVPair {
|
||||
return &KVPair{
|
||||
Key: key,
|
||||
ValueInt: val,
|
||||
ValueType: KVPair_INT,
|
||||
}
|
||||
}
|
||||
|
||||
// KVPairString is a helper method to build KV pair with a string value.
|
||||
func KVPairString(key, val string) *KVPair {
|
||||
return &KVPair{
|
||||
Key: key,
|
||||
ValueString: val,
|
||||
ValueType: KVPair_STRING,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user