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

     1  import * as assert from 'assert';
     2  import { compile } from '../contracts/compile';
     3  import { client } from './test';
     4  
     5  describe('#50', function () {
     6    it('#50', async () => {
     7      const source = `
     8        pragma solidity >=0.0.0;
     9        contract SimpleStorage {
    10            uint storedData;
    11  
    12            function set(uint x) public {
    13                storedData = x;
    14            }
    15  
    16            function get() public view returns (uint retVal) {
    17                return storedData;
    18            }
    19        }
    20      `;
    21      const contract = compile(source, 'SimpleStorage');
    22      const instance = await contract.deploy(client);
    23      await instance.set(42);
    24      const value = await instance.get.call();
    25      assert.deepStrictEqual([...value], [42]);
    26    });
    27  });