forked from TrueCloudLab/frostfs-contract
[#53] common: Use interop.Hash160 in address producing functions
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
91b36a7eb3
commit
d7cb550a5e
1 changed files with 3 additions and 3 deletions
|
@ -25,20 +25,20 @@ func AlphabetNodes() []interop.PublicKey {
|
||||||
}
|
}
|
||||||
|
|
||||||
// AlphabetAddress returns multi address of alphabet public keys.
|
// AlphabetAddress returns multi address of alphabet public keys.
|
||||||
func AlphabetAddress() []byte {
|
func AlphabetAddress() interop.Hash160 {
|
||||||
alphabet := neo.GetCommittee()
|
alphabet := neo.GetCommittee()
|
||||||
return Multiaddress(alphabet, false)
|
return Multiaddress(alphabet, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommitteeAddress returns multi address of committee.
|
// CommitteeAddress returns multi address of committee.
|
||||||
func CommitteeAddress() []byte {
|
func CommitteeAddress() interop.Hash160 {
|
||||||
committee := neo.GetCommittee()
|
committee := neo.GetCommittee()
|
||||||
return Multiaddress(committee, true)
|
return Multiaddress(committee, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Multiaddress returns default multisignature account address for N keys.
|
// Multiaddress returns default multisignature account address for N keys.
|
||||||
// If committee set to true, it is `M = N/2+1` committee account.
|
// If committee set to true, it is `M = N/2+1` committee account.
|
||||||
func Multiaddress(n []interop.PublicKey, committee bool) []byte {
|
func Multiaddress(n []interop.PublicKey, committee bool) interop.Hash160 {
|
||||||
threshold := len(n)*2/3 + 1
|
threshold := len(n)*2/3 + 1
|
||||||
if committee {
|
if committee {
|
||||||
threshold = len(n)/2 + 1
|
threshold = len(n)/2 + 1
|
||||||
|
|
Loading…
Reference in a new issue