Files
zeekay 4a01862566 feat: add TON and Cardano support with comprehensive test coverage
- 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
2025-08-14 20:50:23 -05:00

50 lines
1.3 KiB
Go

package keygen_test
import (
"testing"
"github.com/luxfi/threshold/internal/round"
"github.com/luxfi/threshold/pkg/math/curve"
"github.com/luxfi/threshold/pkg/party"
"github.com/luxfi/threshold/pkg/pool"
"github.com/luxfi/threshold/protocols/lss/keygen"
"github.com/stretchr/testify/require"
)
func TestTraceHandler(t *testing.T) {
group := curve.Secp256k1{}
selfID := party.ID("alice")
participants := []party.ID{"alice", "bob", "charlie"}
threshold := 2
pl := pool.NewPool(0)
defer pl.TearDown()
// Create the first round
startFunc := keygen.Start(selfID, participants, threshold, group, pl)
r1, err := startFunc(nil)
require.NoError(t, err)
t.Logf("Round1 created: Number=%d, Final=%d", r1.Number(), r1.FinalRoundNumber())
t.Logf("SelfID=%s, PartyIDs=%v, OtherPartyIDs=%v",
r1.SelfID(), r1.PartyIDs(), r1.OtherPartyIDs())
// Manually finalize round1 to see what it produces
out := make(chan *round.Message, 10)
r2, err := r1.Finalize(out)
close(out)
if err != nil {
t.Fatalf("Failed to finalize round1: %v", err)
}
msgCount := 0
for msg := range out {
msgCount++
t.Logf("Message %d: Broadcast=%v, Round=%d",
msgCount, msg.Broadcast, msg.Content.RoundNumber())
}
t.Logf("Round1 produced %d messages", msgCount)
t.Logf("Round2 number: %d", r2.Number())
}