Skip to content

Commit

Permalink
Fix bugs in claimReward in PledgeAgent
Browse files Browse the repository at this point in the history
Signed-off-by: charles2023wood <[email protected]>
  • Loading branch information
charles2022wood committed Jul 16, 2024
1 parent a03e747 commit e388e18
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 70 deletions.
6 changes: 3 additions & 3 deletions contracts/BitcoinAgent.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ contract BitcoinAgent is IAgent, System, IParamSubscriber {
/*********************** events **************************/
event paramChange(string key, bytes value);
event claimedReward(address indexed delegator, uint256 amount);
event verifiedMintTx(bytes32 indexed txid, uint32 version, uint32 blockHeight, uint32 outputIndex);
event verifiedMintTx(bytes32 indexed txid, uint32 version, uint32 blockHeight, uint32 outputIndex, uint256 fee);
event verifiedBurnTx(bytes32 indexed txid, uint32 version, uint32 blockHeight, uint32 outputIndex);

function init() external onlyNotInit {
Expand Down Expand Up @@ -127,7 +127,7 @@ contract BitcoinAgent is IAgent, System, IParamSubscriber {
}


/// Start new round, this is called by the CandidateHub contract
/// Start new round, this is called by the StakeHub contract
/// @param validators List of elected validators in this round
/// @param round The new round tag
function setNewRound(address[] calldata validators, uint256 round) external override onlyStakeHub {
Expand Down Expand Up @@ -186,7 +186,7 @@ contract BitcoinAgent is IAgent, System, IParamSubscriber {
br.height = blockHeight;
br.outputIndex = outputIndex;
br.version = version;
emit verifiedMintTx(txid, version, blockHeight, outputIndex);
emit verifiedMintTx(txid, version, blockHeight, outputIndex, fee);
}

function verifyBurnTx(bytes calldata btcTx, uint32 blockHeight, bytes32[] memory nodes, uint256 index) external {
Expand Down
2 changes: 1 addition & 1 deletion contracts/HashPowerAgent.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ contract HashPowerAgent is IAgent, System, IParamSubscriber {
(amounts, totalAmount) = ILightClient(LIGHT_CLIENT_ADDR).getRoundPowers(roundTag-7, candidates);
}

/// Start new round, this is called by the CandidateHub contract
/// Start new round, this is called by the StakeHub contract
/// @param validators List of elected validators in this round
/// @param round The new round tag
function setNewRound(address[] calldata validators, uint256 round) external override onlyStakeHub {
Expand Down
Loading

0 comments on commit e388e18

Please sign in to comment.