Jürgen Eckel 373614e1b2
269 set a chain wide upper gas limit for transactions (#309)
* 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>
2024-02-01 10:23:38 +01:00

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
}