[#1506] morph: Simplify WaitTxHalt() signature

Avoid dependency on `morph/client` package because of `InvokeRes`.
Make signature resemble `WaitAny()` method of `waiter.Waiter` from neo-go.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-12-28 10:20:53 +03:00 committed by Evgenii Stratonikov
parent 85af6bcd5c
commit 198aaebc94
3 changed files with 4 additions and 4 deletions

View file

@ -33,13 +33,13 @@ func (w *waiterClient) GetVersion() (*result.Version, error) {
// WaitTxHalt waits until transaction with the specified hash persists on the blockchain.
// It also checks execution result to finish in HALT state.
func (c *Client) WaitTxHalt(ctx context.Context, p InvokeRes) error {
func (c *Client) WaitTxHalt(ctx context.Context, vub uint32, h util.Uint256) error {
w, err := waiter.NewPollingBased(&waiterClient{c: c})
if err != nil {
return fmt.Errorf("create tx waiter: %w", err)
}
res, err := w.WaitAny(ctx, p.VUB, p.Hash)
res, err := w.WaitAny(ctx, vub, h)
if err != nil {
return fmt.Errorf("wait until tx persists: %w", err)
}