[#240] netmap: Support HomomorphicHashingDisabled
network config
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
df6538c68c
commit
0cd790cfe0
3 changed files with 112 additions and 1 deletions
|
@ -212,3 +212,24 @@ func TestNetworkInfo_WithdrawalFee(t *testing.T) {
|
|||
},
|
||||
)
|
||||
}
|
||||
|
||||
func TestNetworkInfo_HomomorphicHashingDisabled(t *testing.T) {
|
||||
testConfigValue(t,
|
||||
func(x NetworkInfo) interface{} { return x.HomomorphicHashingDisabled() },
|
||||
func(info *NetworkInfo, val interface{}) {
|
||||
if val.(bool) {
|
||||
info.DisableHomomorphicHashing()
|
||||
}
|
||||
},
|
||||
true, true, // it is impossible to enable hashing
|
||||
"HomomorphicHashingDisabled", func(val interface{}) []byte {
|
||||
data := make([]byte, 1)
|
||||
|
||||
if val.(bool) {
|
||||
data[0] = 1
|
||||
}
|
||||
|
||||
return data
|
||||
},
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue