mirror of https://github.com/certusone/dc4bc.git
a little refactoring
This commit is contained in:
parent
958d2ff9fa
commit
944de3741c
|
@ -159,11 +159,10 @@ func (ts *TendermintStorage) genTx(msg Message) (*types.StdTx, error) {
|
|||
return nil, fmt.Errorf("failed to unmarshal response: %w", err)
|
||||
}
|
||||
|
||||
gasEstimate, err := ts.simulateTx(msg)
|
||||
tx.Fee.Gas, err = ts.simulateTx(msg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to simulate tx: %w", err)
|
||||
}
|
||||
tx.Fee.Gas = gasEstimate
|
||||
return &tx, nil
|
||||
}
|
||||
|
||||
|
@ -220,7 +219,7 @@ func (ts *TendermintStorage) signTx(tx types.StdTx) (*types.StdTx, error) {
|
|||
txBuilder := auth.NewTxBuilder(auth.DefaultTxEncoder(app.MakeCodec()), account.GetAccountNumber(),
|
||||
account.GetSequence(), tx.GetGas(), 0, false, ts.chainID, tx.GetMemo(),
|
||||
tx.Fee.Amount, tx.Fee.GasPrices()).WithKeybase(ts.keybase)
|
||||
tx.Fee.Gas = tx.GetGas() * 2
|
||||
tx.Fee.Gas = tx.GetGas() * 2 // Without doubling panic "WritePerByte" occurs. Looks like known issue: https://github.com/cosmos/cosmos-sdk/issues/4938
|
||||
signedTx, err := txBuilder.SignStdTx(ts.name, clientKeys.DefaultKeyPass, tx, false)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to sign tx: %w", err)
|
||||
|
|
|
@ -14,6 +14,10 @@ const (
|
|||
)
|
||||
|
||||
func TestNewTendermintStorage(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping long test")
|
||||
}
|
||||
|
||||
N := 100
|
||||
offset := 4
|
||||
|
||||
|
|
Loading…
Reference in New Issue