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
|
@ -8,6 +8,7 @@ import (
|
|||
. "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
|
||||
usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test"
|
||||
"github.com/mr-tron/base58"
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util/slice"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
@ -47,6 +48,19 @@ func TestID_SetScriptHash(t *testing.T) {
|
|||
require.True(t, id2.Equals(id))
|
||||
}
|
||||
|
||||
func TestID_ScriptHash(t *testing.T) {
|
||||
userID := usertest.ID()
|
||||
|
||||
scriptHash, err := userID.ScriptHash()
|
||||
require.NoError(t, err)
|
||||
|
||||
ownerAddress := userID.EncodeToString()
|
||||
decodedScriptHash, err := address.StringToUint160(ownerAddress)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.True(t, scriptHash.Equals(decodedScriptHash))
|
||||
}
|
||||
|
||||
func TestV2_ID(t *testing.T) {
|
||||
id := usertest.ID()
|
||||
var m refs.OwnerID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue