feat(v1): Vote Extension Auction (#106)

This commit is contained in:
David Terpay
2023-05-09 16:47:27 -04:00
committed by GitHub
parent cc74b9e027
commit 7797110514
9 changed files with 3244 additions and 399 deletions
+23
View File
@@ -125,6 +125,15 @@ func CreateRandomTx(txCfg client.TxConfig, account Account, nonce, numberMsgs, t
return txBuilder.GetTx(), nil
}
func CreateRandomTxBz(txCfg client.TxConfig, account Account, nonce, numberMsgs, timeout uint64) ([]byte, error) {
tx, err := CreateRandomTx(txCfg, account, nonce, numberMsgs, timeout)
if err != nil {
return nil, err
}
return txCfg.TxEncoder()(tx)
}
func CreateTxWithSigners(txCfg client.TxConfig, nonce, timeout uint64, signers []Account) (authsigning.Tx, error) {
msgs := []sdk.Msg{}
for _, signer := range signers {
@@ -199,6 +208,20 @@ func CreateAuctionTxWithSigners(txCfg client.TxConfig, bidder Account, bid sdk.C
return txBuilder.GetTx(), nil
}
func CreateAuctionTxWithSignerBz(txCfg client.TxConfig, bidder Account, bid sdk.Coin, nonce, timeout uint64, signers []Account) ([]byte, error) {
bidTx, err := CreateAuctionTxWithSigners(txCfg, bidder, bid, nonce, timeout, signers)
if err != nil {
return nil, err
}
bz, err := txCfg.TxEncoder()(bidTx)
if err != nil {
return nil, err
}
return bz, nil
}
func CreateRandomMsgs(acc sdk.AccAddress, numberMsgs int) []sdk.Msg {
msgs := make([]sdk.Msg, numberMsgs)
for i := 0; i < numberMsgs; i++ {