2020-08-31 07:46:10 +00:00
|
|
|
package owner
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/rand"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestIDV2(t *testing.T) {
|
2020-09-10 09:57:29 +00:00
|
|
|
id := NewID()
|
2020-08-31 07:46:10 +00:00
|
|
|
|
2020-08-31 08:15:46 +00:00
|
|
|
wallet := new(NEO3Wallet)
|
2020-08-31 07:46:10 +00:00
|
|
|
|
|
|
|
_, err := rand.Read(wallet.Bytes())
|
|
|
|
require.NoError(t, err)
|
|
|
|
|
|
|
|
id.SetNeo3Wallet(wallet)
|
|
|
|
|
|
|
|
idV2 := id.ToV2()
|
|
|
|
|
2020-09-10 09:57:29 +00:00
|
|
|
require.Equal(t, wallet.Bytes(), idV2.GetValue())
|
2020-08-31 07:46:10 +00:00
|
|
|
}
|