Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradStaniec committed Oct 2, 2024
1 parent 722daa8 commit f5b2e32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion testutil/datagen/btcstaking.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ func GenRandomBTCDelegation(
}
staker := GenRandomAccount()

stakingTime := uint16(endHeight - startHeight)

// staking/slashing tx
stakingSlashingInfo := GenBTCStakingSlashingInfo(
r,
Expand All @@ -112,7 +114,7 @@ func GenRandomBTCDelegation(
fpPKs,
covenantPks,
covenantQuorum,
uint16(endHeight-startHeight),
stakingTime,
int64(totalSat),
slashingPkScript,
slashingRate,
Expand Down Expand Up @@ -153,6 +155,7 @@ func GenRandomBTCDelegation(
BtcPk: delBTCPK,
Pop: pop,
FpBtcPkList: fpBTCPKs,
StakingTime: uint32(stakingTime),
StartHeight: startHeight,
EndHeight: endHeight,
TotalSat: totalSat,
Expand Down
1 change: 1 addition & 0 deletions x/btcstaking/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func (ms msgServer) CreateBTCDelegation(goCtx context.Context, req *types.MsgCre
BtcPk: parsedMsg.StakerPK.BIP340PubKey,
Pop: parsedMsg.ParsedPop,
FpBtcPkList: parsedMsg.FinalityProviderKeys.PublicKeysBbnFormat,
StakingTime: uint32(parsedMsg.StakingTime),
StartHeight: startHeight,
EndHeight: endHeight,
TotalSat: uint64(parsedMsg.StakingValue),
Expand Down
4 changes: 2 additions & 2 deletions x/btcstaking/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,8 @@ func createNDelegationsForFinalityProvider(
covenantPks,
quorum,
slashingPkScript,
0,
0+math.MaxUint16,
1,
1+(math.MaxUint16-1),
uint64(stakingValue),
slashingRate,
math.MaxUint16,
Expand Down

0 comments on commit f5b2e32

Please sign in to comment.