Skip to content

Commit 6fc6ee9

Browse files
committed
normalize terminology again. dynamic tx gas limit
1 parent 01ef6ca commit 6fc6ee9

17 files changed

Lines changed: 328 additions & 406 deletions

client/asset/btc/btc_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ func testAvailableFund(t *testing.T, segwit bool, walletType string) {
21972197
}
21982198

21992199
ord := &asset.Order{
2200-
Version: version,
2200+
AssetVersion: version,
22012201
Value: 0,
22022202
MaxSwapCount: 1,
22032203
MaxFeeRate: tBTC.MaxFeeRate,
@@ -2762,7 +2762,7 @@ func TestFundEdges(t *testing.T) {
27622762
unspents := []*ListUnspentResult{p2pkhUnspent}
27632763
node.listUnspent = unspents
27642764
ord := &asset.Order{
2765-
Version: version,
2765+
AssetVersion: version,
27662766
Value: swapVal,
27672767
MaxSwapCount: lots,
27682768
MaxFeeRate: tBTC.MaxFeeRate,
@@ -2986,7 +2986,7 @@ func TestFundEdgesSegwit(t *testing.T) {
29862986
unspents := []*ListUnspentResult{p2wpkhUnspent}
29872987
node.listUnspent = unspents
29882988
ord := &asset.Order{
2989-
Version: version,
2989+
AssetVersion: version,
29902990
Value: swapVal,
29912991
MaxSwapCount: lots,
29922992
MaxFeeRate: tBTC.MaxFeeRate,
@@ -4365,7 +4365,7 @@ func testPreSwap(t *testing.T, segwit bool, walletType string) {
43654365
}
43664366

43674367
form := &asset.PreSwapForm{
4368-
Version: version,
4368+
AssetVersion: version,
43694369
LotSize: tLotSize,
43704370
Lots: lots,
43714371
MaxFeeRate: tBTC.MaxFeeRate,
@@ -4411,8 +4411,8 @@ func testPreRedeem(t *testing.T, segwit bool, walletType string) {
44114411
defer shutdown()
44124412

44134413
preRedeem, err := wallet.PreRedeem(&asset.PreRedeemForm{
4414-
Version: version,
4415-
Lots: 5,
4414+
AssetVersion: version,
4415+
Lots: 5,
44164416
})
44174417
// Shouldn't actually be any path to error.
44184418
if err != nil {

client/asset/btc/livetest/livetest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func Run(t *testing.T, cfg *Config) {
266266
checkAmt("second", rig.secondWallet)
267267

268268
ord := &asset.Order{
269-
Version: 0,
269+
AssetVersion: 0,
270270
Value: contractValue * 3,
271271
MaxSwapCount: lots * 3,
272272
MaxFeeRate: cfg.Asset.MaxFeeRate,

client/asset/btc/simnet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func testWalletTxBalanceSync(t *testing.T, fromWallet, toWallet *ExchangeWalletF
367367
}
368368

369369
order := &asset.Order{
370-
Value: toSatoshi(1),
370+
AssetVersion: toSatoshi(1),
371371
FeeSuggestion: 10,
372372
MaxSwapCount: 1,
373373
MaxFeeRate: 20,

client/asset/dcr/dcr_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ func TestAvailableFund(t *testing.T) {
876876
}
877877

878878
ord := &asset.Order{
879-
Version: version,
879+
AssetVersion: version,
880880
Value: 0,
881881
MaxSwapCount: 1,
882882
MaxFeeRate: tDCR.MaxFeeRate,
@@ -2595,7 +2595,7 @@ func TestFundEdges(t *testing.T) {
25952595

25962596
node.unspent = []walletjson.ListUnspentResult{p2pkhUnspent}
25972597
ord := &asset.Order{
2598-
Version: version,
2598+
AssetVersion: version,
25992599
Value: swapVal,
26002600
MaxSwapCount: lots,
26012601
MaxFeeRate: tDCR.MaxFeeRate,
@@ -3871,7 +3871,7 @@ func TestPreSwap(t *testing.T) {
38713871
node.unspent = []walletjson.ListUnspentResult{p2pkhUnspent}
38723872

38733873
form := &asset.PreSwapForm{
3874-
Version: version,
3874+
AssetVersion: version,
38753875
LotSize: tLotSize,
38763876
Lots: lots,
38773877
MaxFeeRate: tDCR.MaxFeeRate,
@@ -3913,8 +3913,8 @@ func TestPreRedeem(t *testing.T) {
39133913
defer shutdown()
39143914

39153915
preRedeem, err := wallet.PreRedeem(&asset.PreRedeemForm{
3916-
Version: version,
3917-
Lots: 5,
3916+
AssetVersion: version,
3917+
Lots: 5,
39183918
})
39193919
// Shouldn't actually be any path to error.
39203920
if err != nil {

client/asset/dcr/simnet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func runTest(t *testing.T, splitTx bool) {
348348
}
349349

350350
ord := &asset.Order{
351-
Version: tDCR.Version,
351+
AssetVersion: tDCR.Version,
352352
Value: contractValue * 3,
353353
MaxSwapCount: lots * 3,
354354
MaxFeeRate: tDCR.MaxFeeRate,

client/asset/estimation.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ type RedeemEstimate struct {
3838

3939
// PreSwapForm can be used to get a swap fees estimate.
4040
type PreSwapForm struct {
41-
// Version is the asset version. Most backends only support one version.
42-
Version uint32
41+
// AssetVersion is the server's asset version. Most backends only support
42+
// one version.
43+
AssetVersion uint32
4344
// LotSize is the lot size for the calculation. For quote assets, LotSize
4445
// should be based on either the user's limit order rate, or some measure
4546
// of the current market rate.
@@ -83,8 +84,9 @@ type PreSwap struct {
8384

8485
// PreRedeemForm can be used to get a redemption estimate.
8586
type PreRedeemForm struct {
86-
// Version is the asset version. Most backends only support one version.
87-
Version uint32
87+
// AssetVersion is the asset version. Most backends only support one
88+
// version.
89+
AssetVersion uint32
8890
// Lots is the number of lots in the order.
8991
Lots uint64
9092
// FeeSuggestion is a suggested fee from the server.

0 commit comments

Comments
 (0)