mirror of
https://github.com/luxfi/threshold.git
synced 2026-10-30 15:15:53 +00:00
- Add TON blockchain adapter with Ed25519 and Curve25519 support - Add Cardano adapter with native Ed25519 plus ECDSA/Schnorr for interop - TON features: BOC serialization, workchain support, gas estimation - Cardano features: CBOR encoding, Blake2b-256, multi-era support - Fix golangci-lint configuration for CI compatibility - Create comprehensive test suite covering all 20+ blockchains - Ensure 100% build success with no compilation errors - Support for Shelley, Allegra, Mary, Alonzo, Babbage, Conway eras - Ready for production deployment with full test coverage
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package frost_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/luxfi/threshold/internal/test"
|
|
"github.com/luxfi/threshold/pkg/math/curve"
|
|
"github.com/luxfi/threshold/pkg/party"
|
|
"github.com/luxfi/threshold/pkg/protocol"
|
|
"github.com/luxfi/threshold/protocols/frost"
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestFrostKeygenStandard(t *testing.T) {
|
|
N := 5
|
|
T := 3
|
|
|
|
partyIDs := test.PartyIDs(N)
|
|
|
|
// Run the protocol
|
|
results, err := test.RunProtocol(t, partyIDs, nil, func(id party.ID) protocol.StartFunc {
|
|
return frost.Keygen(curve.Secp256k1{}, id, partyIDs, T)
|
|
})
|
|
require.NoError(t, err)
|
|
|
|
// Verify results
|
|
configs := make([]*frost.Config, 0, N)
|
|
for _, result := range results {
|
|
config, ok := result.(*frost.Config)
|
|
require.True(t, ok)
|
|
require.NotNil(t, config)
|
|
configs = append(configs, config)
|
|
}
|
|
|
|
// Verify all have same public key
|
|
require.NotNil(t, configs[0].PublicKey)
|
|
for i := 1; i < len(configs); i++ {
|
|
require.NotNil(t, configs[i].PublicKey)
|
|
assert.True(t, configs[0].PublicKey.Equal(configs[i].PublicKey))
|
|
}
|
|
}
|