mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
les/checkpointoracle: move oracle into its own package (#20508)
* les: move the checkpoint oracle into its own package It's first step of refactor LES package. LES package basically can be divided into LES client and LES server. However both sides will use checkpoint package for status retrieval and verification. So this PR moves checkpoint oracle into a separate package * les: address comments
This commit is contained in:
parent
d17526e43d
commit
49621dc4d1
@ -29,8 +29,9 @@ import (
|
||||
"github.com/ledgerwatch/turbo-geth/core/types"
|
||||
)
|
||||
|
||||
// CheckpointOracle is a Go wrapper around an on-chain light client checkpoint oracle.
|
||||
// CheckpointOracle is a Go wrapper around an on-chain checkpoint oracle contract.
|
||||
type CheckpointOracle struct {
|
||||
address common.Address
|
||||
contract *contract.CheckpointOracle
|
||||
}
|
||||
|
||||
@ -40,7 +41,12 @@ func NewCheckpointOracle(contractAddr common.Address, backend bind.ContractBacke
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &CheckpointOracle{contract: c}, nil
|
||||
return &CheckpointOracle{address: contractAddr, contract: c}, nil
|
||||
}
|
||||
|
||||
// ContractAddr returns the address of contract.
|
||||
func (oracle *CheckpointOracle) ContractAddr() common.Address {
|
||||
return oracle.address
|
||||
}
|
||||
|
||||
// Contract returns the underlying contract instance.
|
||||
|
Loading…
Reference in New Issue
Block a user