mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-07-02 10:52:30 +00:00

* set global tx gas limit * extend lib/tx to process multiple messages * extend lib/tx to configure tx gas limit * added global gas limit tests * increased account funding to support needs of testcases Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
30 lines
693 B
Go
30 lines
693 B
Go
package e2e
|
|
|
|
import (
|
|
"bytes"
|
|
"errors"
|
|
"testing"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
"github.com/planetmint/planetmint-go/lib"
|
|
)
|
|
|
|
// BuildSignBroadcastTx builds, signs and broadcasts transaction to the network.
|
|
func BuildSignBroadcastTx(t *testing.T, addr sdk.AccAddress, msgs ...sdk.Msg) (out *bytes.Buffer, err error) {
|
|
out, err = lib.BroadcastTxWithFileLock(addr, msgs...)
|
|
if err != nil {
|
|
t.Log("broadcast tx failed: " + err.Error())
|
|
return
|
|
}
|
|
txResponse, err := lib.GetTxResponseFromOut(out)
|
|
if err != nil {
|
|
t.Log("getting tx response from out failed: " + err.Error())
|
|
return
|
|
}
|
|
if txResponse.Code != 0 {
|
|
err = errors.New(txResponse.RawLog)
|
|
return
|
|
}
|
|
return
|
|
}
|