From 417d18fa8fa9f0562a4cc40447d1a3525afce105 Mon Sep 17 00:00:00 2001 From: RafilxTenfen Date: Mon, 25 Nov 2024 22:17:39 -0300 Subject: [PATCH] chore: add new field to transaction tracked of tx hash of btc delegation --- itest/e2e_test.go | 2 +- itest/manager.go | 3 + proto/transaction.pb.go | 161 +++++++---------------- proto/transaction.proto | 1 + staker/events.go | 7 +- staker/stakerapp.go | 21 ++- stakerdb/trackedtranactionstore.go | 3 +- stakerdb/trackedtransactionstore_test.go | 3 +- 8 files changed, 77 insertions(+), 124 deletions(-) diff --git a/itest/e2e_test.go b/itest/e2e_test.go index 232c49f..f527d26 100644 --- a/itest/e2e_test.go +++ b/itest/e2e_test.go @@ -967,7 +967,7 @@ func TestStakeFromPhase1(t *testing.T) { params, err := cl.Params() require.NoError(t, err) - tm.mineNEmptyBlocks(t, params.ConfirmationTimeBlocks, true) + tm.mineNEmptyBlocks(t, params.ConfirmationTimeBlocks+1, true) tm.waitForStakingTxState(t, txHash, proto.TransactionState_SENT_TO_BABYLON) pend, err := tm.BabylonClient.QueryPendingBTCDelegations() diff --git a/itest/manager.go b/itest/manager.go index 2620676..6f0306b 100644 --- a/itest/manager.go +++ b/itest/manager.go @@ -1144,6 +1144,8 @@ func (tm *TestManager) insertCovenantSigForDelegation( btcutil.Amount(btcDel.TotalSat), regtestParams, ) + require.NoError(t, err) + slashingPathInfo, err := stakingInfo.SlashingPathSpendInfo() require.NoError(t, err) @@ -1159,6 +1161,7 @@ func (tm *TestManager) insertCovenantSigForDelegation( // slash unbonding tx spends unbonding tx unbondingMsgTx, _, err := bbntypes.NewBTCTxFromHex(btcDel.UndelegationResponse.UnbondingTxHex) require.NoError(t, err) + unbondingInfo, err := staking.BuildUnbondingInfo( btcDel.BtcPk.MustToBTCPK(), fpBTCPKs, diff --git a/proto/transaction.pb.go b/proto/transaction.pb.go index 9870fd3..e8836bc 100644 --- a/proto/transaction.pb.go +++ b/proto/transaction.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 +// protoc-gen-go v1.35.1 // protoc v3.6.1 // source: transaction.proto @@ -101,11 +101,9 @@ type WatchedTxData struct { func (x *WatchedTxData) Reset() { *x = WatchedTxData{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *WatchedTxData) String() string { @@ -116,7 +114,7 @@ func (*WatchedTxData) ProtoMessage() {} func (x *WatchedTxData) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -199,11 +197,9 @@ type BTCConfirmationInfo struct { func (x *BTCConfirmationInfo) Reset() { *x = BTCConfirmationInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *BTCConfirmationInfo) String() string { @@ -214,7 +210,7 @@ func (*BTCConfirmationInfo) ProtoMessage() {} func (x *BTCConfirmationInfo) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -254,11 +250,9 @@ type CovenantSig struct { func (x *CovenantSig) Reset() { *x = CovenantSig{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CovenantSig) String() string { @@ -269,7 +263,7 @@ func (*CovenantSig) ProtoMessage() {} func (x *CovenantSig) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -313,11 +307,9 @@ type UnbondingTxData struct { func (x *UnbondingTxData) Reset() { *x = UnbondingTxData{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UnbondingTxData) String() string { @@ -328,7 +320,7 @@ func (*UnbondingTxData) ProtoMessage() {} func (x *UnbondingTxData) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -393,16 +385,15 @@ type TrackedTransaction struct { State TransactionState `protobuf:"varint,10,opt,name=state,proto3,enum=proto.TransactionState" json:"state,omitempty"` Watched bool `protobuf:"varint,11,opt,name=watched,proto3" json:"watched,omitempty"` // this data is only filled if tracked transactions state is >= SENT_TO_BABYLON - UnbondingTxData *UnbondingTxData `protobuf:"bytes,12,opt,name=unbonding_tx_data,json=unbondingTxData,proto3" json:"unbonding_tx_data,omitempty"` + UnbondingTxData *UnbondingTxData `protobuf:"bytes,12,opt,name=unbonding_tx_data,json=unbondingTxData,proto3" json:"unbonding_tx_data,omitempty"` + BtcDelegationTxHash string `protobuf:"bytes,13,opt,name=btcDelegationTxHash,proto3" json:"btcDelegationTxHash,omitempty"` } func (x *TrackedTransaction) Reset() { *x = TrackedTransaction{} - if protoimpl.UnsafeEnabled { - mi := &file_transaction_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_transaction_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TrackedTransaction) String() string { @@ -413,7 +404,7 @@ func (*TrackedTransaction) ProtoMessage() {} func (x *TrackedTransaction) ProtoReflect() protoreflect.Message { mi := &file_transaction_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -512,6 +503,13 @@ func (x *TrackedTransaction) GetUnbondingTxData() *UnbondingTxData { return nil } +func (x *TrackedTransaction) GetBtcDelegationTxHash() string { + if x != nil { + return x.BtcDelegationTxHash + } + return "" +} + var File_transaction_proto protoreflect.FileDescriptor var file_transaction_proto_rawDesc = []byte{ @@ -574,7 +572,7 @@ var file_transaction_proto_rawDesc = []byte{ 0x42, 0x54, 0x43, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x1e, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x42, 0x74, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x6e, 0x66, 0x6f, 0x22, 0x84, 0x05, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x54, + 0x6e, 0x66, 0x6f, 0x22, 0xb6, 0x05, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x17, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x74, 0x72, 0x61, @@ -614,21 +612,24 @@ var file_transaction_proto_rawDesc = []byte{ 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x78, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x75, 0x6e, 0x62, 0x6f, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x2a, 0xa5, 0x01, 0x0a, 0x10, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x0f, 0x0a, 0x0b, 0x53, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x4f, 0x5f, 0x42, 0x54, 0x43, 0x10, 0x00, - 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x4f, 0x4e, - 0x5f, 0x42, 0x54, 0x43, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x4e, 0x54, 0x5f, 0x54, - 0x4f, 0x5f, 0x42, 0x41, 0x42, 0x59, 0x4c, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x56, - 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x45, 0x4c, - 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x04, - 0x12, 0x1e, 0x0a, 0x1a, 0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, - 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x4f, 0x4e, 0x5f, 0x42, 0x54, 0x43, 0x10, 0x05, - 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x50, 0x45, 0x4e, 0x54, 0x5f, 0x4f, 0x4e, 0x5f, 0x42, 0x54, 0x43, - 0x10, 0x06, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x62, 0x61, 0x62, 0x79, 0x6c, 0x6f, 0x6e, 0x6c, 0x61, 0x62, 0x73, 0x2d, 0x69, 0x6f, 0x2f, - 0x62, 0x74, 0x63, 0x2d, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x69, 0x6e, 0x67, 0x54, 0x78, 0x44, 0x61, 0x74, 0x61, 0x12, 0x30, 0x0a, 0x13, 0x62, 0x74, + 0x63, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x78, 0x48, 0x61, 0x73, + 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x62, 0x74, 0x63, 0x44, 0x65, 0x6c, 0x65, + 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x2a, 0xa5, 0x01, 0x0a, + 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x53, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x4f, 0x5f, 0x42, 0x54, 0x43, + 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, + 0x4f, 0x4e, 0x5f, 0x42, 0x54, 0x43, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x4f, 0x5f, 0x42, 0x41, 0x42, 0x59, 0x4c, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0c, 0x0a, + 0x08, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x44, + 0x45, 0x4c, 0x45, 0x47, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, + 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x55, 0x4e, 0x42, 0x4f, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, + 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x5f, 0x4f, 0x4e, 0x5f, 0x42, 0x54, 0x43, + 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x50, 0x45, 0x4e, 0x54, 0x5f, 0x4f, 0x4e, 0x5f, 0x42, + 0x54, 0x43, 0x10, 0x06, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x62, 0x79, 0x6c, 0x6f, 0x6e, 0x6c, 0x61, 0x62, 0x73, 0x2d, 0x69, + 0x6f, 0x2f, 0x62, 0x74, 0x63, 0x2d, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -645,7 +646,7 @@ func file_transaction_proto_rawDescGZIP() []byte { var file_transaction_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_transaction_proto_goTypes = []interface{}{ +var file_transaction_proto_goTypes = []any{ (TransactionState)(0), // 0: proto.TransactionState (*WatchedTxData)(nil), // 1: proto.WatchedTxData (*BTCConfirmationInfo)(nil), // 2: proto.BTCConfirmationInfo @@ -671,68 +672,6 @@ func file_transaction_proto_init() { if File_transaction_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_transaction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchedTxData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BTCConfirmationInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CovenantSig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnbondingTxData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_transaction_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TrackedTransaction); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/proto/transaction.proto b/proto/transaction.proto index 24266cd..d2115d1 100644 --- a/proto/transaction.proto +++ b/proto/transaction.proto @@ -67,4 +67,5 @@ message TrackedTransaction { bool watched = 11; // this data is only filled if tracked transactions state is >= SENT_TO_BABYLON UnbondingTxData unbonding_tx_data = 12; + string btcDelegationTxHash = 13; } diff --git a/staker/events.go b/staker/events.go index 49ad6fc..fa12cd1 100644 --- a/staker/events.go +++ b/staker/events.go @@ -40,9 +40,10 @@ func (event *stakingTxBtcConfirmedEvent) EventDesc() string { } type delegationSubmittedToBabylonEvent struct { - stakingTxHash chainhash.Hash - unbondingTx *wire.MsgTx - unbondingTime uint16 + stakingTxHash chainhash.Hash + btcDelegationTxHash string + unbondingTx *wire.MsgTx + unbondingTime uint16 } func (event *delegationSubmittedToBabylonEvent) EventID() chainhash.Hash { diff --git a/staker/stakerapp.go b/staker/stakerapp.go index d1940ab..185a744 100644 --- a/staker/stakerapp.go +++ b/staker/stakerapp.go @@ -1389,7 +1389,6 @@ func (app *App) handlePostApprovalCmd( bestBlockHeight := app.currentBestBlockHeight.Load() err := app.wc.UnlockWallet(defaultWalletUnlockTimeout) - if err != nil { return nil, err } @@ -1575,15 +1574,23 @@ func (app *App) handleStakingCommands() { continue } - if err := app.txTracker.SetTxSentToBabylon(&stkTxHash, delData.Ud.UnbondingTransaction, delData.Ud.UnbondingTxUnbondingTime); err != nil { - cmd.errChan <- err - continue + err = app.txTracker.SetTxSentToBabylon(&stkTxHash, resp.TxHash, delData.Ud.UnbondingTransaction, delData.Ud.UnbondingTxUnbondingTime) + if err != nil { + utils.PushOrQuit( + cmd.errChan, + err, + app.quit, + ) + } else { + utils.PushOrQuit( + cmd.successChanTxHash, + resp.TxHash, + app.quit, + ) } - app.logger.WithFields(logrus.Fields{ "consumerBtcDelegationTxHash": resp.TxHash, }).Debugf("Sending BTC delegation was a success") - cmd.successChanTxHash <- resp.TxHash case <-app.quit: return } @@ -1635,7 +1642,7 @@ func (app *App) handleStakingEvents() { case ev := <-app.delegationSubmittedToBabylonEvChan: app.logStakingEventReceived(ev) - if err := app.txTracker.SetTxSentToBabylon(&ev.stakingTxHash, ev.unbondingTx, ev.unbondingTime); err != nil { + if err := app.txTracker.SetTxSentToBabylon(&ev.stakingTxHash, ev.btcDelegationTxHash, ev.unbondingTx, ev.unbondingTime); err != nil { // TODO: handle this error somehow, it means we received confirmation for tx which we do not store // which is seems like programming error. Maybe panic? app.logger.Fatalf("Error setting state for tx %s: %s", ev.stakingTxHash, err) diff --git a/stakerdb/trackedtranactionstore.go b/stakerdb/trackedtranactionstore.go index 4b10f82..177b5ab 100644 --- a/stakerdb/trackedtranactionstore.go +++ b/stakerdb/trackedtranactionstore.go @@ -974,11 +974,11 @@ func (c *TrackedTransactionStore) SetTxConfirmed( func (c *TrackedTransactionStore) SetTxSentToBabylon( txHash *chainhash.Hash, + btcDelegationTxHash string, unbondingTx *wire.MsgTx, unbondingTime uint16, ) error { update, err := newInitialUnbondingTxData(unbondingTx, unbondingTime) - if err != nil { return err } @@ -990,6 +990,7 @@ func (c *TrackedTransactionStore) SetTxSentToBabylon( tx.State = proto.TransactionState_SENT_TO_BABYLON tx.UnbondingTxData = update + tx.BtcDelegationTxHash = btcDelegationTxHash return nil } diff --git a/stakerdb/trackedtransactionstore_test.go b/stakerdb/trackedtransactionstore_test.go index 1d546f0..6e00689 100644 --- a/stakerdb/trackedtransactionstore_test.go +++ b/stakerdb/trackedtransactionstore_test.go @@ -213,7 +213,7 @@ func TestStateTransitions(t *testing.T) { require.Equal(t, height, storedTx.StakingTxConfirmationInfo.Height) // Sent to Babylon - err = s.SetTxSentToBabylon(&txHash, tx.StakingTx, tx.StakingTime) + err = s.SetTxSentToBabylon(&txHash, hash.String(), tx.StakingTx, tx.StakingTime) require.NoError(t, err) storedTx, err = s.GetTransaction(&txHash) require.NoError(t, err) @@ -357,6 +357,7 @@ func FuzzQuerySpendableTx(f *testing.F) { txHash := storedTx.StakingTx.TxHash() err := s.SetTxSentToBabylon( &txHash, + txHash.String(), storedTx.StakingTx, storedTx.StakingTime, )