Skip to content

Commit

Permalink
Remove restaking test
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradStaniec committed Nov 22, 2024
1 parent 2be6731 commit 4741371
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 45 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
cosmossdk.io/errors v1.0.1
cosmossdk.io/math v1.4.0
github.com/avast/retry-go/v4 v4.5.1
github.com/babylonlabs-io/babylon v0.17.0
github.com/babylonlabs-io/babylon v0.17.1
github.com/babylonlabs-io/networks/parameters v0.2.2
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/btcec/v2 v2.3.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1432,8 +1432,8 @@ github.com/aws/aws-sdk-go v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX
github.com/aws/aws-sdk-go v1.44.312 h1:llrElfzeqG/YOLFFKjg1xNpZCFJ2xraIi3PqSuP+95k=
github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/babylonlabs-io/babylon v0.17.0 h1:jUNnfOAK3P0MOlyNDErTKoB2/q6kMNIYM2tM//8ZUBc=
github.com/babylonlabs-io/babylon v0.17.0/go.mod h1:sT+KG2U+M0tDMNZZ2L5CwlXX0OpagGEs56BiWXqaZFw=
github.com/babylonlabs-io/babylon v0.17.1 h1:lyWGdR7B49qDw5pllLyTW/HAM5uQWXXPZefjFzy/Xy0=
github.com/babylonlabs-io/babylon v0.17.1/go.mod h1:sT+KG2U+M0tDMNZZ2L5CwlXX0OpagGEs56BiWXqaZFw=
github.com/babylonlabs-io/networks/parameters v0.2.2 h1:TCu39fZvjX5f6ZZrjhYe54M6wWxglNewuKu56yE+zrc=
github.com/babylonlabs-io/networks/parameters v0.2.2/go.mod h1:iEJVOzaLsE33vpP7J4u+CRGfkSIfErUAwRmgCFCBpyI=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Expand Down
42 changes: 0 additions & 42 deletions itest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1839,48 +1839,6 @@ func TestBitcoindWalletBip322Signing(t *testing.T) {
require.NoError(t, err)
}

func TestSendingStakingTransaction_Restaking(t *testing.T) {
t.Parallel()
// need to have at least 300 block on testnet as only then segwit is activated.
// Mature output is out which has 100 confirmations, which means 200mature outputs
// will generate 300 blocks
numMatureOutputs := uint32(200)
ctx, cancel := context.WithCancel(context.Background())
tm := StartManager(t, ctx, numMatureOutputs)
defer tm.Stop(t, cancel)
tm.insertAllMinedBlocksToBabylon(t)

cl := tm.Sa.BabylonController()
params, err := cl.Params()
require.NoError(t, err)

// restaked to 5 finality providers
testStakingData := tm.getTestStakingData(t, tm.WalletPubKey, params.MinStakingTime, 10000, 5)

hashed, err := chainhash.NewHash(datagen.GenRandomByteArray(r, 32))
require.NoError(t, err)
scr, err := txscript.PayToTaprootScript(tm.CovenantPrivKeys[0].PubKey())
require.NoError(t, err)
_, st, erro := tm.Sa.Wallet().TxDetails(hashed, scr)
// query for exsisting tx is not an error, proper state should be returned
require.NoError(t, erro)
require.Equal(t, st, walletcontroller.TxNotFound)

tm.createAndRegisterFinalityProviders(t, testStakingData)

txHash := tm.sendStakingTxBTC(t, testStakingData, false)

go tm.mineNEmptyBlocks(t, params.ConfirmationTimeBlocks, true)
tm.waitForStakingTxState(t, txHash, proto.TransactionState_SENT_TO_BABYLON)

pend, err := tm.BabylonClient.QueryPendingBTCDelegations()
require.NoError(t, err)
require.Len(t, pend, 1)
// need to activate delegation to unbond
tm.insertCovenantSigForDelegation(t, pend[0])
tm.waitForStakingTxState(t, txHash, proto.TransactionState_DELEGATION_ACTIVE)
}

func TestRecoverAfterRestartDuringWithdrawal(t *testing.T) {
t.Parallel()
// need to have at least 300 block on testnet as only then segwit is activated.
Expand Down

0 comments on commit 4741371

Please sign in to comment.