Skip to content

Commit

Permalink
Fix proto
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 committed Sep 17, 2024
1 parent cd79f49 commit 47239dd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
17 changes: 15 additions & 2 deletions order_fulfiller.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import (
"context"
"fmt"
"slices"
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/dymensionxyz/cosmosclient/cosmosclient"
"go.uber.org/zap"

"github.com/dymensionxyz/cosmosclient/cosmosclient"

"github.com/dymensionxyz/eibc-client/types"
)

Expand Down Expand Up @@ -144,6 +146,8 @@ outer:
return nil
}

time.Sleep(7 * time.Second)

ol.logger.Info("fulfilling orders", zap.Int("count", len(ids)))

if err := ol.fulfillDemandOrders(demandOrders...); err != nil {
Expand Down Expand Up @@ -181,7 +185,16 @@ func (ol *orderFulfiller) fulfillDemandOrders(demandOrder ...*demandOrder) error
msgs := make([]sdk.Msg, len(demandOrder))

for i, order := range demandOrder {
msgs[i] = types.NewMsgFulfillOrder(ol.accountSvc.account.GetAddress().String(), order.id, order.fee)
if order.fee == "" {
continue
}
fee, err := sdk.ParseCoinNormalized(order.fee)
if err != nil {
return fmt.Errorf("failed to parse fee: %w", err)
}
feeAmount := fee.Amount.String()

msgs[i] = types.NewMsgFulfillOrder(ol.accountSvc.account.GetAddress().String(), order.id, feeAmount)
}

_, err := ol.client.BroadcastTx(ol.accountSvc.accountName, msgs...)
Expand Down
4 changes: 4 additions & 0 deletions types/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ func (msg *MsgFulfillOrder) Type() string {
return sdk.MsgTypeURL(msg)
}

func (*MsgFulfillOrder) XXX_MessageName() string {
return "dymensionxyz.dymension.eibc.MsgFulfillOrder"
}

func (msg *MsgFulfillOrder) GetSigners() []sdk.AccAddress {
creator, err := sdk.AccAddressFromBech32(msg.FulfillerAddress)
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions types/tx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 47239dd

Please sign in to comment.