From 2186d671636c19233064b6124335105a67853082 Mon Sep 17 00:00:00 2001 From: andri lim Date: Mon, 5 Sep 2022 17:00:05 +0700 Subject: [PATCH] fix openssl problem in ci (#533) * tighter nimcrypto imports * install openssl on macos for Nim devel * add getTotalDifficulty base method to AbtractChainDB Co-authored-by: Jacek Sieka --- .github/workflows/ci.yml | 7 +++++++ eth/common/chaindb.nim | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c95574..172042d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,13 @@ jobs: chmod 755 external/bin/gcc external/bin/g++ echo '${{ github.workspace }}/external/bin' >> $GITHUB_PATH + - name: 'Install dependencies (macOS)' + if: runner.os == 'macOS' && matrix.branch == 'devel' + run: | + brew install openssl@1.1 + ln -s $(brew --prefix)/opt/openssl/lib/libcrypto.1.1.dylib /usr/local/lib/ + ln -s $(brew --prefix)/opt/openssl/lib/libssl.1.1.dylib /usr/local/lib/ + - name: Restore rocksdb from cache (Macos) if: runner.os != 'Windows' id: rocksdb-cache diff --git a/eth/common/chaindb.nim b/eth/common/chaindb.nim index 697da62..9475077 100644 --- a/eth/common/chaindb.nim +++ b/eth/common/chaindb.nim @@ -55,7 +55,7 @@ method getAncestorHeader*(db: AbstractChainDB, h: BlockHeader, notImplemented("getAncestorHeader") method getBlockBody*(db: AbstractChainDB, blockHash: KeccakHash): BlockBodyRef - {.base, gcsafe, raises: [Defect].} = + {.base, gcsafe, raises: [RlpError, Defect].} = notImplemented("getBlockBody") method getReceipt*(db: AbstractChainDB, hash: KeccakHash): ReceiptRef {.base, gcsafe.} = @@ -95,3 +95,6 @@ method persistBlocks*(db: AbstractChainDB, headers: openArray[BlockHeader], bodi method getForkId*(db: AbstractChainDB, n: BlockNumber): ForkID {.base, gcsafe.} = # EIP 2364/2124 notImplemented("getForkId") + +method getTotalDifficulty*(db: AbstractChainDB): DifficultyInt {.base, gcsafe, raises: [RlpError, Defect].} = + notImplemented("getTotalDifficulty")