rpc: adjust getrawtransaction and gettransactionheight RPC call

We should return verbose transaction in case if it is in the mempool
from `getrawtransaction`. We also shouldn't return height from
`gettransactionheight` in case if transaction is in the mempool.
This commit is contained in:
Anna Shaleva 2020-11-13 16:54:38 +03:00
parent 860d2ca7a7
commit 083879838c
4 changed files with 37 additions and 39 deletions

View file

@ -6,6 +6,7 @@ import (
"errors"
"io"
"io/ioutil"
"math"
"strings"
"testing"
"time"
@ -123,7 +124,7 @@ func (e *executor) GetTransaction(t *testing.T, h util.Uint256) (*transaction.Tr
require.Eventually(t, func() bool {
var err error
tx, height, err = e.Chain.GetTransaction(h)
return err == nil && height != 0
return err == nil && height != math.MaxUint32
}, time.Second*2, time.Millisecond*100, "too long time waiting for block")
return tx, height
}