forked from TrueCloudLab/frostfs-sdk-go
[#198] object/user: Add ScriptHash method
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
parent
7efff9d53d
commit
65b4525b3b
2 changed files with 19 additions and 0 deletions
|
@ -72,6 +72,11 @@ func (x *ID) SetScriptHash(scriptHash util.Uint160) {
|
|||
copy(x.w[21:], hash.Checksum(x.w[:21]))
|
||||
}
|
||||
|
||||
// ScriptHash calculates and returns script hash of ID.
|
||||
func (x *ID) ScriptHash() (util.Uint160, error) {
|
||||
return util.Uint160DecodeBytesBE(x.w[1:21])
|
||||
}
|
||||
|
||||
// WalletBytes returns FrostFS user ID as Neo3 wallet address in a binary format.
|
||||
//
|
||||
// Return value MUST NOT be mutated: to do this, first make a copy.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue