crosslightning-evm
Advanced tools
Comparing version 3.0.8 to 3.0.9
@@ -276,9 +276,12 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const spvTipCommitment = yield this.contract.getLatestMainChainCommitmentHash(); | ||
const highScoreAndBlockHeight = yield this.contract._highScoreAndBlockHeight(); | ||
const chainWork = Buffer.from(highScoreAndBlockHeight.and(ethers_1.BigNumber.from("0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")).toHexString().substring(2).padStart(64, "0"), "hex"); | ||
const blockheight = highScoreAndBlockHeight.shr(224).toNumber(); | ||
if (blockheight === 0) | ||
return null; | ||
const spvTipCommitment = yield this.contract.getLatestMainChainCommitmentHash(); | ||
return { | ||
commitHash: spvTipCommitment.substring(2), | ||
chainWork, | ||
blockheight: highScoreAndBlockHeight.shr(224).toNumber() | ||
blockheight | ||
}; | ||
@@ -285,0 +288,0 @@ }); |
{ | ||
"name": "crosslightning-evm", | ||
"version": "3.0.8", | ||
"version": "3.0.9", | ||
"description": "EVM specific base implementation", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -320,3 +320,2 @@ import {BitcoinRpc, BtcBlock, BtcRelay, StatePredictorUtils} from "crosslightning-base"; | ||
const spvTipCommitment: string = await this.contract.getLatestMainChainCommitmentHash(); | ||
const highScoreAndBlockHeight: BigNumber = await this.contract._highScoreAndBlockHeight(); | ||
@@ -328,7 +327,12 @@ | ||
); | ||
const blockheight: number = highScoreAndBlockHeight.shr(224).toNumber(); | ||
if(blockheight===0) return null; | ||
const spvTipCommitment: string = await this.contract.getLatestMainChainCommitmentHash(); | ||
return { | ||
commitHash: spvTipCommitment.substring(2), | ||
chainWork, | ||
blockheight: highScoreAndBlockHeight.shr(224).toNumber() | ||
blockheight | ||
} | ||
@@ -335,0 +339,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
337809
8045