forked from kaspanet/kaspad
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherrypick: Add fee estimation to wallet (kaspanet#2291)
* Add fee estimation to wallet * Add fee rate to kaspawallet parse * Update go version * Get rid of golint * Add RBF support to wallet * Fix bump_fee UTXO lookup and fix wrong change address * impl storage mass as per KIP9 * Use CalculateTransactionOverallMass where needed * Some fixes * Minor typos * Fix test * update version * BroadcastRBF -> BroadcastReplacement * rc3 * align proto files to only use camel case (fixed on RK as well) * Rename to FeePolicy and add MaxFee option + todo * apply max fee constrains * increase minChangeTarget to 10kas * fmt * Some fixes * fix description: maximum -> minimum * put min feerate check in the correct location * Fix calculateFeeLimits nil handling * Add validations to CLI flags * Change to rc6 * Add checkTransactionFeeRate * Add failed broadcast transactions on send error` * Fix estimateFee change value * Estimate fee correctly for --send-all * On estimateFee always assume that the recipient has ECDSA address * remove patch version --------- Co-authored-by: Michael Sutton <[email protected]>
- Loading branch information
1 parent
8554694
commit 2a8c3a8
Showing
58 changed files
with
7,137 additions
and
1,624 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 |
---|---|---|
|
@@ -53,6 +53,7 @@ _testmain.go | |
debug | ||
debug.test | ||
__debug_bin | ||
*__debug_* | ||
|
||
# CI | ||
version.txt | ||
|
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package appmessage | ||
|
||
// GetFeeEstimateRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetFeeEstimateRequestMessage struct { | ||
baseMessage | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetFeeEstimateRequestMessage) Command() MessageCommand { | ||
return CmdGetFeeEstimateRequestMessage | ||
} | ||
|
||
// NewGetFeeEstimateRequestMessage returns a instance of the message | ||
func NewGetFeeEstimateRequestMessage() *GetFeeEstimateRequestMessage { | ||
return &GetFeeEstimateRequestMessage{} | ||
} | ||
|
||
type RPCFeeRateBucket struct { | ||
Feerate float64 | ||
EstimatedSeconds float64 | ||
} | ||
|
||
type RPCFeeEstimate struct { | ||
PriorityBucket RPCFeeRateBucket | ||
NormalBuckets []RPCFeeRateBucket | ||
LowBuckets []RPCFeeRateBucket | ||
} | ||
|
||
// GetCoinSupplyResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type GetFeeEstimateResponseMessage struct { | ||
baseMessage | ||
Estimate RPCFeeEstimate | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *GetFeeEstimateResponseMessage) Command() MessageCommand { | ||
return CmdGetFeeEstimateResponseMessage | ||
} | ||
|
||
// NewGetFeeEstimateResponseMessage returns a instance of the message | ||
func NewGetFeeEstimateResponseMessage() *GetFeeEstimateResponseMessage { | ||
return &GetFeeEstimateResponseMessage{} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package appmessage | ||
|
||
// SubmitTransactionReplacementRequestMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type SubmitTransactionReplacementRequestMessage struct { | ||
baseMessage | ||
Transaction *RPCTransaction | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *SubmitTransactionReplacementRequestMessage) Command() MessageCommand { | ||
return CmdSubmitTransactionReplacementRequestMessage | ||
} | ||
|
||
// NewSubmitTransactionReplacementRequestMessage returns a instance of the message | ||
func NewSubmitTransactionReplacementRequestMessage(transaction *RPCTransaction) *SubmitTransactionReplacementRequestMessage { | ||
return &SubmitTransactionReplacementRequestMessage{ | ||
Transaction: transaction, | ||
} | ||
} | ||
|
||
// SubmitTransactionReplacementResponseMessage is an appmessage corresponding to | ||
// its respective RPC message | ||
type SubmitTransactionReplacementResponseMessage struct { | ||
baseMessage | ||
TransactionID string | ||
ReplacedTransaction *RPCTransaction | ||
|
||
Error *RPCError | ||
} | ||
|
||
// Command returns the protocol command string for the message | ||
func (msg *SubmitTransactionReplacementResponseMessage) Command() MessageCommand { | ||
return CmdSubmitTransactionReplacementResponseMessage | ||
} | ||
|
||
// NewSubmitTransactionReplacementResponseMessage returns a instance of the message | ||
func NewSubmitTransactionReplacementResponseMessage(transactionID string) *SubmitTransactionReplacementResponseMessage { | ||
return &SubmitTransactionReplacementResponseMessage{ | ||
TransactionID: transactionID, | ||
} | ||
} |
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
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
Oops, something went wrong.