Skip to content

Commit

Permalink
Change block height to proof height
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 committed Oct 10, 2024
1 parent 5d5de58 commit a8416a5
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions proto/dymensionxyz/dymension/eibc/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ message EventDemandOrderCreated {
string recipient = 8;
// packet_type is the type of the packet.
string packet_type = 9;
// block_height is the height of the block.
uint64 block_height = 10;
// proof_height is the height of the block when order was created.
uint64 proof_height = 10;
}

// EventDemandOrderPacketStatusUpdate is emitted when the status of the related packet is updated.
Expand Down
2 changes: 1 addition & 1 deletion x/eibc/keeper/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (k Keeper) EIBCDemandOrderHandler(ctx sdk.Context, rollappPacket commontype
return fmt.Errorf("set eibc demand order: %w", err)
}

if err = uevent.EmitTypedEvent(ctx, eibcDemandOrder.GetCreatedEvent(uint64(ctx.BlockHeight()))); err != nil {
if err = uevent.EmitTypedEvent(ctx, eibcDemandOrder.GetCreatedEvent(rollappPacket.ProofHeight)); err != nil {
return fmt.Errorf("emit event: %w", err)
}

Expand Down
4 changes: 2 additions & 2 deletions x/eibc/types/demand_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (m *DemandOrder) Validate() error {
return nil
}

func (m *DemandOrder) GetCreatedEvent(blockHeight uint64) *EventDemandOrderCreated {
func (m *DemandOrder) GetCreatedEvent(proofHeight uint64) *EventDemandOrderCreated {
packetKey := base64.StdEncoding.EncodeToString([]byte(m.TrackingPacketKey))
return &EventDemandOrderCreated{
OrderId: m.Id,
Expand All @@ -83,7 +83,7 @@ func (m *DemandOrder) GetCreatedEvent(blockHeight uint64) *EventDemandOrderCreat
RollappId: m.RollappId,
Recipient: m.Recipient,
PacketType: m.Type.String(),
BlockHeight: blockHeight,
ProofHeight: proofHeight,
}
}

Expand Down
76 changes: 38 additions & 38 deletions x/eibc/types/events.pb.go

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

0 comments on commit a8416a5

Please sign in to comment.