63c8d6e9ea
Replace owner.NEO3Wallet usage with owner.ID usage. Functions that process the wallet address convert it to the owner identifier through the public method. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
26 lines
360 B
Go
26 lines
360 B
Go
package owner
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestIDV2(t *testing.T) {
|
|
id := new(ID)
|
|
|
|
wallet := new(NEO3Wallet)
|
|
|
|
_, err := rand.Read(wallet.Bytes())
|
|
require.NoError(t, err)
|
|
|
|
id.SetNeo3Wallet(wallet)
|
|
|
|
idV2 := id.ToV2()
|
|
|
|
id2, err := IDFromV2(idV2)
|
|
require.NoError(t, err)
|
|
|
|
require.Equal(t, id, id2)
|
|
}
|