github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/src/test/48.test.ts (about)

     1  import * as assert from 'assert';
     2  import { compile } from '../contracts/compile';
     3  import { client } from './test';
     4  
     5  describe('#48', function () {
     6    it('#48', async () => {
     7      const source = `
     8        pragma solidity >=0.0.0;
     9        contract Test {
    10  
    11            function getAddress() public view returns (address) {
    12              return address(this);
    13            }
    14  
    15            function getNumber() public pure returns (uint) {
    16              return 100;
    17            }
    18  
    19            function getCombination() public view returns (uint _number, address _address) {
    20              _number = 100;
    21              _address = address(this);
    22            }
    23  
    24        }
    25      `;
    26      const contract = compile(source, 'Test');
    27      return contract
    28        .deploy(client)
    29        .then((instance: any) => instance.getCombination())
    30        .then(([number, address]) => {
    31          assert.strictEqual(number, 100);
    32          assert.strictEqual(address.length, 40);
    33        });
    34    });
    35  });