From 49621dc4d116c0534ffaa2efe6f78d68fb4b36fd Mon Sep 17 00:00:00 2001 From: Igor Mandrigin <i@mandrigin.ru> Date: Wed, 29 Jan 2020 15:48:32 +0200 Subject: [PATCH] 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 --- contracts/checkpointoracle/oracle.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contracts/checkpointoracle/oracle.go b/contracts/checkpointoracle/oracle.go index 0d44a35587..879f986bb2 100644 --- a/contracts/checkpointoracle/oracle.go +++ b/contracts/checkpointoracle/oracle.go @@ -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. -- GitLab