mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 00:43:46 +00:00
fix: conflicts from previous merge
This commit is contained in:
commit
d6e552bdcf
4 changed files with 33 additions and 5 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
|
@ -19,7 +19,7 @@ jobs:
|
||||||
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
|
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-20.04, macos-11 ] # list of os: https://github.com/actions/virtual-environments
|
os: [ ubuntu-20.04 ] # list of os: https://github.com/actions/virtual-environments
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
@ -63,7 +63,7 @@ jobs:
|
||||||
|
|
||||||
- name: test-integration
|
- name: test-integration
|
||||||
run: make test-integration
|
run: make test-integration
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -533,10 +533,23 @@ func toBlockNumArg(number *big.Int) string {
|
||||||
if number == nil {
|
if number == nil {
|
||||||
return "latest"
|
return "latest"
|
||||||
}
|
}
|
||||||
|
|
||||||
pending := big.NewInt(-1)
|
pending := big.NewInt(-1)
|
||||||
|
finalized := big.NewInt(int64(rpc.FinalizedBlockNumber))
|
||||||
|
safe := big.NewInt(int64(rpc.SafeBlockNumber))
|
||||||
|
|
||||||
if number.Cmp(pending) == 0 {
|
if number.Cmp(pending) == 0 {
|
||||||
return "pending"
|
return "pending"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if number.Cmp(finalized) == 0 {
|
||||||
|
return "finalized"
|
||||||
|
}
|
||||||
|
|
||||||
|
if number.Cmp(safe) == 0 {
|
||||||
|
return "safe"
|
||||||
|
}
|
||||||
|
|
||||||
return hexutil.EncodeBig(number)
|
return hexutil.EncodeBig(number)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -183,10 +183,23 @@ func toBlockNumArg(number *big.Int) string {
|
||||||
if number == nil {
|
if number == nil {
|
||||||
return "latest"
|
return "latest"
|
||||||
}
|
}
|
||||||
|
|
||||||
pending := big.NewInt(-1)
|
pending := big.NewInt(-1)
|
||||||
|
finalized := big.NewInt(int64(rpc.FinalizedBlockNumber))
|
||||||
|
safe := big.NewInt(int64(rpc.SafeBlockNumber))
|
||||||
|
|
||||||
if number.Cmp(pending) == 0 {
|
if number.Cmp(pending) == 0 {
|
||||||
return "pending"
|
return "pending"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if number.Cmp(finalized) == 0 {
|
||||||
|
return "finalized"
|
||||||
|
}
|
||||||
|
|
||||||
|
if number.Cmp(safe) == 0 {
|
||||||
|
return "safe"
|
||||||
|
}
|
||||||
|
|
||||||
return hexutil.EncodeBig(number)
|
return hexutil.EncodeBig(number)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,9 +61,11 @@ type jsonWriter interface {
|
||||||
type BlockNumber int64
|
type BlockNumber int64
|
||||||
|
|
||||||
const (
|
const (
|
||||||
PendingBlockNumber = BlockNumber(-2)
|
SafeBlockNumber = BlockNumber(-4)
|
||||||
LatestBlockNumber = BlockNumber(-1)
|
FinalizedBlockNumber = BlockNumber(-3)
|
||||||
EarliestBlockNumber = BlockNumber(0)
|
PendingBlockNumber = BlockNumber(-2)
|
||||||
|
LatestBlockNumber = BlockNumber(-1)
|
||||||
|
EarliestBlockNumber = BlockNumber(0)
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnmarshalJSON parses the given JSON fragment into a BlockNumber. It supports:
|
// UnmarshalJSON parses the given JSON fragment into a BlockNumber. It supports:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue