mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 13:38:35 +00:00
9015e50847
Rename it to Neo.Crypto.CheckMultisig and remove `message` parameter.
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package core
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/config"
|
|
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
|
|
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGenesisBlockMainNet(t *testing.T) {
|
|
cfg, err := config.Load("../../config", netmode.MainNet)
|
|
require.NoError(t, err)
|
|
|
|
block, err := createGenesisBlock(cfg.ProtocolConfiguration)
|
|
require.NoError(t, err)
|
|
|
|
expect := "de3bfe3e328af04d48f62bd7a9c533641cc0e1fb6a7741c5119d6a6eaedc5269"
|
|
assert.Equal(t, expect, block.Hash().StringLE())
|
|
}
|
|
|
|
func TestGetConsensusAddressMainNet(t *testing.T) {
|
|
var (
|
|
consensusAddr = "NSX179gdoQmF8nu34rQdL4dYAfdCQhHtQS"
|
|
consensusScript = "4870eaa62eee7c76b76d2ae933d4c027f5f5c77d"
|
|
)
|
|
|
|
cfg, err := config.Load("../../config", netmode.MainNet)
|
|
require.NoError(t, err)
|
|
|
|
validators, err := validatorsFromConfig(cfg.ProtocolConfiguration)
|
|
require.NoError(t, err)
|
|
|
|
script, err := getNextConsensusAddress(validators)
|
|
require.NoError(t, err)
|
|
|
|
assert.Equal(t, consensusScript, script.String())
|
|
assert.Equal(t, consensusAddr, address.Uint160ToString(script))
|
|
}
|