-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use discounted liquid transaction size
- Loading branch information
1 parent
d68bef2
commit 6bd6081
Showing
6 changed files
with
8 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,3 @@ | ||
//go:build !unit | ||
|
||
package onchain_test | ||
|
||
import ( | ||
"github.com/BoltzExchange/boltz-client/boltz" | ||
onchainmock "github.com/BoltzExchange/boltz-client/mocks/github.com/BoltzExchange/boltz-client/onchain" | ||
"github.com/BoltzExchange/boltz-client/onchain" | ||
"github.com/BoltzExchange/boltz-client/onchain/wallet" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
func TestEstimateLowballFee(t *testing.T) { | ||
boltzApi := &boltz.Api{URL: "https://api.boltz.exchange"} | ||
blocks := onchainmock.NewMockBlockProvider(t) | ||
chain := &onchain.Onchain{ | ||
Liquid: &onchain.Currency{ | ||
Tx: onchain.NewBoltzTxProvider(boltzApi, boltz.CurrencyLiquid), | ||
Blocks: blocks, | ||
}, | ||
Network: boltz.MainNet, | ||
} | ||
blocks.EXPECT().EstimateFee().Return(0.1, nil) | ||
|
||
fee, err := chain.EstimateFee(boltz.CurrencyLiquid, true) | ||
require.NoError(t, err) | ||
require.Equal(t, fee, wallet.MinFeeRate) | ||
|
||
fee, err = chain.EstimateFee(boltz.CurrencyLiquid, false) | ||
require.NoError(t, err) | ||
require.Greater(t, fee, wallet.MinFeeRate) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters