Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add block height in RefundRecord #273

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proto/fx/crosschain/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ message RefundRecord {
uint64 timeout = 3;
repeated ERC20Token tokens = 4 [(gogoproto.nullable) = false];
uint64 oracle_set_nonce = 5;
uint64 block = 6;
}

message SnapshotOracle {
Expand Down
1 change: 1 addition & 0 deletions x/crosschain/keeper/bridge_call_refund.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
Timeout: k.GetBridgeCallRefundTimeout(ctx),
OracleSetNonce: oracleSet.Nonce,
Tokens: tokens,
Block: uint64(ctx.BlockHeight()),
Dismissed Show dismissed Hide dismissed
})
return nil
}
Expand Down
5 changes: 5 additions & 0 deletions x/crosschain/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2444,6 +2444,7 @@ func (suite *CrossChainGrpcTestSuite) TestKeeper_RefundRecordByNonce() {
Timeout: tmrand.Uint64(),
Tokens: nil,
OracleSetNonce: uint64(tmrand.Int63n(10000)),
Block: tmrand.Uint64(),
}
suite.Keeper().SetRefundRecord(suite.ctx, refundRecord)
request = &types.QueryRefundRecordByNonceRequest{
Expand Down Expand Up @@ -2494,6 +2495,7 @@ func (suite *CrossChainGrpcTestSuite) TestKeeper_RefundRecordByReceiver() {
Timeout: tmrand.Uint64(),
Tokens: nil,
OracleSetNonce: uint64(tmrand.Int63n(10000)),
Block: tmrand.Uint64(),
}
suite.Keeper().SetRefundRecord(suite.ctx, refundRecord)
request = &types.QueryRefundRecordByReceiverRequest{
Expand Down Expand Up @@ -2573,6 +2575,7 @@ func (suite *CrossChainGrpcTestSuite) TestKeeper_RefundConfirmByNonce() {
Timeout: tmrand.Uint64(),
Tokens: nil,
OracleSetNonce: oracleNonce,
Block: tmrand.Uint64(),
}
suite.Keeper().SetRefundRecord(suite.ctx, refundRecord)

Expand Down Expand Up @@ -2646,6 +2649,7 @@ func (suite *CrossChainGrpcTestSuite) TestKeeper_LastPendingRefundRecordByAddr()
Timeout: tmrand.Uint64(),
Tokens: nil,
OracleSetNonce: oracleNonce,
Block: tmrand.Uint64(),
}
suite.Keeper().SetRefundRecord(suite.ctx, refundRecord)

Expand Down Expand Up @@ -2696,6 +2700,7 @@ func (suite *CrossChainGrpcTestSuite) TestKeeper_LastPendingRefundRecordByAddr()
Timeout: tmrand.Uint64(),
Tokens: nil,
OracleSetNonce: oracleNonce,
Block: tmrand.Uint64(),
}
suite.Keeper().SetRefundRecord(suite.ctx, refundRecordNew)
request = &types.QueryLastPendingRefundRecordByAddrRequest{
Expand Down
1 change: 1 addition & 0 deletions x/crosschain/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,7 @@ func (suite *KeeperTestSuite) TestConfirmRefund() {
Timeout: tmrand.Uint64(),
Tokens: tokens,
OracleSetNonce: oracleSetNonce,
Block: tmrand.Uint64(),
}
suite.Keeper().SetRefundRecord(suite.ctx, refundRecord)

Expand Down
Loading
Loading