hello everyone,
is there any way to get balance of my smart contract in jest (.spec.ts files) without defining a getter on the smart contract itself?
Mar 14, 2023, 12:59 PM
let balanceOfContract = (await blockchain.getContract(contract.address)).balance
Anybody knows how to convert Cell to string and back?
Mar 14, 2023, 1:12 PM
it worked, thanks. ππ»
where? in func or ts?
Mar 14, 2023, 1:12 PM
ts
Mar 14, 2023, 1:13 PM
Mar 14, 2023, 1:16 PM
You need toBoc first
Mar 14, 2023, 1:18 PM
const _code = await compile('history-keeper')
const codestring: string = _code.asSlice().toString()
code = Cell.fromBase64(codestring)
const codestring: string = _code.asSlice().toString()
code = Cell.fromBase64(codestring)
I tried this, but it doesn't work
What you mean?
Mar 14, 2023, 1:24 PM
cell.toBoc
Mar 14, 2023, 1:25 PM
Like this:
const _code = await compile('history-keeper')
const codestring: string = btoa(_code.toBoc().toString())
code = Cell.fromBase64(codestring)
const _code = await compile('history-keeper')
const codestring: string = btoa(_code.toBoc().toString())
code = Cell.fromBase64(codestring)
Mar 14, 2023, 1:25 PM
toBoc().toString('base64')
Mar 14, 2023, 1:25 PM
Nice! Thank you manπ
Mar 14, 2023, 1:26 PM