UNPKG

@sofaws/dapp-core

Version:

A library to hold the main logic for a dapp on the Elrond Network

3 lines (2 loc) 2.04 kB
"use strict";import{a as n}from"../../../../../__chunks__/chunk-BNOXD7GM.js";import{a as r}from"../../../../../__chunks__/chunk-TBQFSFXY.js";import{a as p}from"../../../../../__chunks__/chunk-V4XSYEH7.js";import"../../../../../__chunks__/chunk-JBJD3IUJ.js";import"../../../../../__chunks__/chunk-QFTWB3KE.js";import{e as c,f as d,p as i,s as l}from"../../../../../__chunks__/chunk-ZR7YL3KO.js";import"../../../../../__chunks__/chunk-27DX5WIQ.js";import"../../../../../__chunks__/chunk-X2JZA2ND.js";import"../../../../../__chunks__/chunk-MV7THB7B.js";import"../../../../../__chunks__/chunk-C32UB6VS.js";import"../../../../../__chunks__/chunk-NXNVZGZT.js";import"../../../../../__chunks__/chunk-OI3JNSRI.js";import"../../../../../__chunks__/chunk-6AJRSKSP.js";import"../../../../../__chunks__/chunk-TXKA5HXY.js";import"../../../../../__chunks__/chunk-C5OJNYCD.js";import"../../../../../__chunks__/chunk-3TSUQSLU.js";import"../../../../../__chunks__/chunk-7QE2X3X4.js";import"../../../../../__chunks__/chunk-CLAJ4EPW.js";import"../../../../../__chunks__/chunk-P6M5SGWP.js";import{a,b as s,m as o}from"../../../../../__chunks__/chunk-HBP5N4FR.js";o();l();import f from"bignumber.js";describe("getReceiptMessage",()=>{it("returns empty string if no data exists on the transaction receipt field",()=>{let e=s(a({},n),{receipt:void 0}),t=r(e);expect(t).toEqual("")}),it(`returns a message that contains the refunded gas value if the receipt data field contains ${i}`,()=>{let e=s(a({},n),{receipt:{data:i,value:"1000",sender:""}}),t=r(e),u=p({input:e.receipt.value,decimals:c,digits:d,showLastNonZeroDecimal:!0}),m=new f(u).times(e.gasPrice).times(100);expect(t).toEqual(`${e.receipt.data}: ${m}`)}),it(`returns a message that contains the receipt data field value and the receipt value if the receipt data field does not contains ${i}`,()=>{let e=s(a({},n),{receipt:{data:"@some-data",value:"1000",sender:"sender-hash"}}),t=r(e);expect(t).toEqual(`${e.receipt.data}: ${e.receipt.value}`)})}); //# sourceMappingURL=getReceiptMessage.test.js.map