Skip to content

Commit

Permalink
Fix amount check at deposit validate lost after merges (#145)
Browse files Browse the repository at this point in the history
* fix amount check at deposit validate lost after merges

* fix tests

* update tests

* update tests
  • Loading branch information
pavelkrolevets authored Oct 22, 2024
1 parent 9ca6c05 commit 559ddf0
Show file tree
Hide file tree
Showing 1,375 changed files with 1,599 additions and 672 deletions.
48 changes: 0 additions & 48 deletions integration_test/init_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,54 +41,6 @@ var (
operatorKey = "./certs/localhost.key"
)

func TestInitHappyFlows(t *testing.T) {
err := logging.SetGlobalLogger("info", "capital", "console", nil)
require.NoError(t, err)
logger := zap.L().Named("integration-tests")
version := "test.version"
stubClient := &stubs.Client{
CallContractF: func(call ethereum.CallMsg) ([]byte, error) {
return nil, nil
},
}
servers, ops := createOperators(t, version, stubClient)
clnt, err := initiator.New(ops, logger, version, rootCert)
require.NoError(t, err)
withdraw := newEthAddress(t)
owner := newEthAddress(t)
t.Run("test 4 operators init happy flow", func(t *testing.T) {
id := spec.NewID()
depositData, ks, proofs, err := clnt.StartDKG(id, withdraw.Bytes(), []uint64{11, 22, 33, 44}, "mainnet", owner, 0, uint64(spec_crypto.MIN_ACTIVATION_BALANCE))
require.NoError(t, err)
err = validator.ValidateResults([]*wire.DepositDataCLI{depositData}, ks, [][]*wire.SignedProof{proofs}, 1, owner, 0, withdraw)
require.NoError(t, err)
})
t.Run("test 7 operators init happy flow", func(t *testing.T) {
id := spec.NewID()
depositData, ks, proofs, err := clnt.StartDKG(id, withdraw.Bytes(), []uint64{11, 22, 33, 44, 55, 66, 77}, "mainnet", owner, 0, uint64(spec_crypto.MIN_ACTIVATION_BALANCE))
require.NoError(t, err)
err = validator.ValidateResults([]*wire.DepositDataCLI{depositData}, ks, [][]*wire.SignedProof{proofs}, 1, owner, 0, withdraw)
require.NoError(t, err)
})
t.Run("test 10 operators init happy flow", func(t *testing.T) {
id := spec.NewID()
depositData, ks, proofs, err := clnt.StartDKG(id, withdraw.Bytes(), []uint64{11, 22, 33, 44, 55, 66, 77, 88, 99, 100}, "mainnet", owner, 0, uint64(spec_crypto.MIN_ACTIVATION_BALANCE))
require.NoError(t, err)
err = validator.ValidateResults([]*wire.DepositDataCLI{depositData}, ks, [][]*wire.SignedProof{proofs}, 1, owner, 0, withdraw)
require.NoError(t, err)
})
t.Run("test 13 operators init happy flow", func(t *testing.T) {
id := spec.NewID()
depositData, ks, proofs, err := clnt.StartDKG(id, withdraw.Bytes(), []uint64{11, 22, 33, 44, 55, 66, 77, 88, 99, 100, 111, 122, 133}, "mainnet", owner, 0, uint64(spec_crypto.MIN_ACTIVATION_BALANCE))
require.NoError(t, err)
err = validator.ValidateResults([]*wire.DepositDataCLI{depositData}, ks, [][]*wire.SignedProof{proofs}, 1, owner, 0, withdraw)
require.NoError(t, err)
})
for _, srv := range servers {
srv.HttpSrv.Close()
}
}

func TestInitOperatorsThreshold(t *testing.T) {
err := logging.SetGlobalLogger("info", "capital", "console", nil)
require.NoError(t, err)
Expand Down
Loading

0 comments on commit 559ddf0

Please sign in to comment.