Skip to content

Commit

Permalink
chore: modify breath block interval for test (#2054)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonberg1997 authored Dec 11, 2023
1 parent 3414e56 commit 6744d7c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
45 changes: 43 additions & 2 deletions consensus/parlia/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -3926,6 +3926,19 @@ const stakeABI = `
"type": "receive",
"stateMutability": "payable"
},
{
"type": "function",
"name": "BREATH_BLOCK_INTERVAL",
"inputs": [],
"outputs": [
{
"name": "",
"type": "uint256",
"internalType": "uint256"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "DEAD_ADDRESS",
Expand Down Expand Up @@ -4028,6 +4041,24 @@ const stakeABI = `
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "claimBatch",
"inputs": [
{
"name": "operatorAddresses",
"type": "address[]",
"internalType": "address[]"
},
{
"name": "requestNumbers",
"type": "uint256[]",
"internalType": "uint256[]"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "createValidator",
Expand Down Expand Up @@ -4347,6 +4378,11 @@ const stakeABI = `
"type": "address",
"internalType": "address"
},
{
"name": "createdTime",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "voteAddress",
"type": "bytes",
Expand Down Expand Up @@ -4491,7 +4527,7 @@ const stakeABI = `
"internalType": "address"
},
{
"name": "dayIndex",
"name": "index",
"type": "uint256",
"internalType": "uint256"
}
Expand All @@ -4515,7 +4551,7 @@ const stakeABI = `
"internalType": "address"
},
{
"name": "dayIndex",
"name": "index",
"type": "uint256",
"internalType": "uint256"
}
Expand Down Expand Up @@ -5198,6 +5234,11 @@ const stakeABI = `
"name": "InvalidMoniker",
"inputs": []
},
{
"type": "error",
"name": "InvalidRequest",
"inputs": []
},
{
"type": "error",
"name": "InvalidValue",
Expand Down
4 changes: 2 additions & 2 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ func (p *Parlia) Finalize(chain consensus.ChainHeaderReader, header *types.Heade
if p.chainConfig.IsFeynman(header.Number, header.Time) {
// TODO: revert this
// if time.Unix(int64(parent.Time), 0).Day() < time.Unix(int64(header.Time), 0).Day() {
if time.Unix(int64(header.Time), 0).Minute()%5 > time.Unix(int64(parent.Time), 0).Minute()%5 {
if time.Unix(int64(header.Time), 0).Minute() > time.Unix(int64(parent.Time), 0).Minute() {
if err := p.updateValidatorSetV2(state, header, cx, txs, receipts, systemTxs, usedGas, false); err != nil {
return err
}
Expand Down Expand Up @@ -1262,7 +1262,7 @@ func (p *Parlia) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *
if p.chainConfig.IsFeynman(header.Number, header.Time) {
// TODO: revert this
// if time.Unix(int64(parent.Time), 0).Day() < time.Unix(int64(header.Time), 0).Day() {
if time.Unix(int64(header.Time), 0).Minute()%5 > time.Unix(int64(parent.Time), 0).Minute()%5 {
if time.Unix(int64(header.Time), 0).Minute() > time.Unix(int64(parent.Time), 0).Minute() {
if err := p.updateValidatorSetV2(state, header, cx, &txs, &receipts, nil, &header.GasUsed, true); err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit 6744d7c

Please sign in to comment.