当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript abi-decoder.decodeLogs函数代码示例

本文整理汇总了TypeScript中abi-decoder.decodeLogs函数的典型用法代码示例。如果您正苦于以下问题:TypeScript decodeLogs函数的具体用法?TypeScript decodeLogs怎么用?TypeScript decodeLogs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了decodeLogs函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: queryLogsForEvent

export async function queryLogsForEvent(
    txHash: string,
    eventName: string,
): Promise<ABIDecoder.DecodedLog | undefined> {
    const receipt = await web3.eth.getTransactionReceipt(txHash);
    return _.find(ABIDecoder.decodeLogs(receipt.logs), { name: eventName });
}
开发者ID:TheRealest,项目名称:charta,代码行数:7,代码来源:log_utils.ts

示例2: before

                before(async () => {
                    await principalToken.setBalance.sendTransactionAsync(PAYER, Units.ether(1.1), {
                        from: CONTRACT_OWNER,
                    });
                    await principalToken.approve.sendTransactionAsync(
                        tokenTransferProxy.address,
                        Units.ether(1.1),
                        { from: PAYER },
                    );

                    payerBalanceBefore = await principalToken.balanceOf.callAsync(PAYER);
                    beneficiaryBalanceBefore = await principalToken.balanceOf.callAsync(
                        BENEFICIARY_1,
                    );

                    const txHash = await router.repay.sendTransactionAsync(
                        agreementId,
                        Units.ether(1.1),
                        principalToken.address,
                        { from: PAYER },
                    );
                    receipt = await web3.eth.getTransactionReceipt(txHash);

                    [repaymentLog] = _.compact(ABIDecoder.decodeLogs(receipt.logs));
                });
开发者ID:TheRealest,项目名称:charta,代码行数:25,代码来源:repayment_router.ts

示例3: submitMultiSigTransaction

export async function submitMultiSigTransaction(
    multiSig: DharmaMultiSigWalletContract,
    contract: BaseContract,
    methodName: string,
    args: any[],
    txData: TxData,
): Promise<BigNumber> {
    ABIDecoder.addABI(multiSig.abi);

    const encodedTransaction = await contract.web3ContractInstance[methodName].getData.apply(
        null,
        args,
    );

    const txHash = await multiSig.submitTransaction.sendTransactionAsync(
        contract.address,
        // Ether value - 0.
        new BigNumber(0),
        encodedTransaction,
        txData,
    );

    // Get the transaction ID from the logs.
    const receipt = await web3.eth.getTransactionReceipt(txHash);

    const submission = ABIDecoder.decodeLogs(receipt.logs)[0] as DecodedLog<
        MultiSigSubmissionEventArgs
    >;
    const transactionId = submission.events[0].value;

    ABIDecoder.removeABI(multiSig.abi);

    return transactionId;
}
开发者ID:TheRealest,项目名称:charta,代码行数:34,代码来源:multisig.ts

示例4: getLogs

    protected async getLogs(
        txHash: string,
        event: string,
    ): Promise<ABIDecoder.DecodedLog | undefined> {
        const receipt = await web3.eth.getTransactionReceipt(txHash);

        return _.find(ABIDecoder.decodeLogs(receipt.logs), { name: event });
    }
开发者ID:TheRealest,项目名称:charta,代码行数:8,代码来源:collateralized_simple_interest_terms_contract.ts

示例5: before

 before(async () => {
     const txHash = await debtToken.transfer.sendTransactionAsync(
         TOKEN_OWNER_2,
         DEBT_ENTRY_1.getTokenId(),
         { from: TOKEN_OWNER_2 },
     );
     const res = await web3.eth.getTransactionReceipt(txHash);
     [transferLog] = ABIDecoder.decodeLogs(res.logs);
 });
开发者ID:TheRealest,项目名称:charta,代码行数:9,代码来源:debt_token.ts

示例6: it

                it("should emit a log saying the debt is edited", () => {
                    const [logReturned] = ABIDecoder.decodeLogs(res.logs);
                    const logExpected = LogModifyEntryBeneficiary(
                        registry.address,
                        entry.getIssuanceHash(),
                        entry.getBeneficiary(),
                        BENEFICIARY_2,
                    );

                    expect(logReturned).to.deep.equal(logExpected);
                });
开发者ID:TheRealest,项目名称:charta,代码行数:11,代码来源:debt_registry.ts

示例7: it

                    it("should emit approval log", () => {
                        const [approvalLog] = ABIDecoder.decodeLogs(res.logs);
                        const logExpected = LogApproval(
                            debtToken.address,
                            TOKEN_OWNER_1,
                            NULL_ADDRESS,
                            DEBT_ENTRY_2.getTokenId(),
                        );

                        expect(approvalLog).to.deep.equal(logExpected);
                    });
开发者ID:TheRealest,项目名称:charta,代码行数:11,代码来源:debt_token.ts

示例8: it

                    it("should not emit log indicating success", async () => {
                        const txHash = await termsContract.registerTermStart.sendTransactionAsync(
                            ARBITRARY_AGREEMENT_ID,
                            DEBTOR,
                            {
                                from: MOCK_DEBT_KERNEL_ADDRESS,
                            },
                        );

                        const receipt = await web3.eth.getTransactionReceipt(txHash);
                        expect(_.compact(ABIDecoder.decodeLogs(receipt.logs))).to.be.empty;
                    });
开发者ID:TheRealest,项目名称:charta,代码行数:12,代码来源:simple_interest_terms_contract.ts

示例9: it

                it("should emit log that collateral has been secured", async () => {
                    const receipt = await web3.eth.getTransactionReceipt(txHash);
                    const [collateralLockedLog] = compact(ABIDecoder.decodeLogs(receipt.logs));

                    expect(collateralLockedLog).to.deep.equal(
                        CollateralLocked(
                            collateralizer.address,
                            scenario.agreementId,
                            mockCollateralToken.address,
                            scenario.expectedCollateralAmount,
                        ),
                    );
                });
开发者ID:TheRealest,项目名称:charta,代码行数:13,代码来源:collateralize.ts


注:本文中的abi-decoder.decodeLogs函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。