diff --git a/flake.lock b/flake.lock index bb9bfbe0..ca365b02 100644 --- a/flake.lock +++ b/flake.lock @@ -86,17 +86,17 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1718716287, - "narHash": "sha256-rThaCGm+cfFwcAfwUzULZVZ/fdpD+nD37PyKhjWSX2M=", + "lastModified": 1728894785, + "narHash": "sha256-46HJYn1DJCp1+L+hUs8H90IkOsz2BDJVuYJI/pI/Jk4=", "owner": "blockstream", "repo": "lwk", - "rev": "14bac284fe712dd6fdbbbe82bda179a2a236b2fa", + "rev": "9ddd20a806625bb40cd063ad61d80d106809a9fd", "type": "github" }, "original": { "owner": "blockstream", "repo": "lwk", - "rev": "14bac284fe712dd6fdbbbe82bda179a2a236b2fa", + "rev": "9ddd20a806625bb40cd063ad61d80d106809a9fd", "type": "github" } }, diff --git a/flake.nix b/flake.nix index 44c1a13c..69f61b75 100644 --- a/flake.nix +++ b/flake.nix @@ -10,10 +10,10 @@ # blockstream-electrs: init at 0.4.1 #299761 # https://github.com/NixOS/nixpkgs/pull/299761/commits/680d27ad847801af781e0a99e4b87ed73965c69a nixpkgs2.url = "github:NixOS/nixpkgs/680d27ad847801af781e0a99e4b87ed73965c69a"; - # lwk: init at wasm_0.6.3 #14bac28 - # https://github.com/Blockstream/lwk/releases/tag/wasm_0.6.3 + # lwk: init at 9ddd20a806625bb40cd063ad61d80d106809a9fd + # https://github.com/Blockstream/lwk/commit/9ddd20a806625bb40cd063ad61d80d106809a9fd lwk-flake = { - url = "github:blockstream/lwk/14bac284fe712dd6fdbbbe82bda179a2a236b2fa"; + url = "github:blockstream/lwk/9ddd20a806625bb40cd063ad61d80d106809a9fd"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; diff --git a/lwk/client.go b/lwk/client.go index 2254b197..5bdef1c5 100644 --- a/lwk/client.go +++ b/lwk/client.go @@ -99,8 +99,9 @@ type unvalidatedAddressee struct { type sendRequest struct { Addressees []*unvalidatedAddressee `json:"addressees"` // Optional fee rate in sat/vb - FeeRate *float64 `json:"fee_rate,omitempty"` - WalletName string `json:"name"` + FeeRate *float64 `json:"fee_rate,omitempty"` + WalletName string `json:"name"` + EnableCtDiscount bool `json:"enable_ct_discount"` } type sendResponse struct { diff --git a/lwk/lwkwallet.go b/lwk/lwkwallet.go index 166dd62c..12474498 100644 --- a/lwk/lwkwallet.go +++ b/lwk/lwkwallet.go @@ -30,7 +30,7 @@ const ( // Set up here because ctx is not inherited throughout the current codebase. defaultContextTimeout = time.Second * 5 minimumFee SatPerVByte = 0.1 - supportedCLIVersion = "0.5.1" + supportedCLIVersion = "0.8.0" ) func SatPerVByteFromFeeBTCPerKb(feeBTCPerKb float64) SatPerVByte { @@ -169,8 +169,9 @@ func (r *LWKRpcWallet) CreateAndBroadcastTransaction(swapParams *swap.OpeningPar Satoshi: swapParams.Amount, }, }, - WalletName: r.c.GetWalletName(), - FeeRate: &feerate, + WalletName: r.c.GetWalletName(), + FeeRate: &feerate, + EnableCtDiscount: true, }) if err != nil { return "", "", 0, err @@ -233,6 +234,7 @@ func (r *LWKRpcWallet) SendToAddress(address string, amount Satoshi) (string, er Satoshi: amount, }, }, + EnableCtDiscount: true, }) if err != nil { return "", err diff --git a/test/utils.go b/test/utils.go index 8708b1a5..97e22587 100644 --- a/test/utils.go +++ b/test/utils.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" ) -const defaultLines = 30 +const defaultLines = 1000 func IsIntegrationTest(t *testing.T) { if os.Getenv("RUN_INTEGRATION_TESTS") != "1" { diff --git a/testframework/elements.go b/testframework/elements.go index 38d6a630..f67bde6e 100644 --- a/testframework/elements.go +++ b/testframework/elements.go @@ -32,6 +32,11 @@ func getLiquiddConfig() map[string]string { "initialfreecoins": "2100000000000000", "validatepegin": "0", "chain": "liquidregtest", + "acceptdiscountct": "1", + "creatediscountct": "1", + "minrelaytxfee": "0.00000001", + "mintxfee": "0.00000001", + "blockmintxfee": "0.00000001", } }