forked from cerc-io/ipld-eth-server
Use most recent blockNumber when blockNumber parame is nil
This commit is contained in:
parent
0e837e2d03
commit
84e77f259d
@ -15,6 +15,7 @@ func main() {
|
|||||||
environment := flag.String("environment", "", "Environment name")
|
environment := flag.String("environment", "", "Environment name")
|
||||||
contractHash := flag.String("contract-hash", "", "Contract hash to show summary")
|
contractHash := flag.String("contract-hash", "", "Contract hash to show summary")
|
||||||
_blockNumber := flag.Int64("block-number", -1, "Block number of summary")
|
_blockNumber := flag.Int64("block-number", -1, "Block number of summary")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
config := cmd.LoadConfig(*environment)
|
config := cmd.LoadConfig(*environment)
|
||||||
|
@ -24,6 +24,9 @@ type GethBlockchain struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (blockchain *GethBlockchain) GetLogs(contract core.Contract, blockNumber *big.Int) ([]core.Log, error) {
|
func (blockchain *GethBlockchain) GetLogs(contract core.Contract, blockNumber *big.Int) ([]core.Log, error) {
|
||||||
|
if blockNumber == nil {
|
||||||
|
blockNumber = blockchain.latestBlock()
|
||||||
|
}
|
||||||
contractAddress := common.HexToAddress(contract.Hash)
|
contractAddress := common.HexToAddress(contract.Hash)
|
||||||
fc := ethereum.FilterQuery{
|
fc := ethereum.FilterQuery{
|
||||||
FromBlock: blockNumber,
|
FromBlock: blockNumber,
|
||||||
|
Loading…
Reference in New Issue
Block a user