Function mockScCall

  • Set mock for smartcontract call. When called multiple time, mocked values will be added in the mock stack.

    Example

    test('mocked SC call', () => {
    const addr = new Address(
    'A12BqZEQ6sByhRLyEuf0YbQmcF2PsDdkNNG1akBJu9XcjZA1eT',
    );
    const mockValue: StaticArray<u8> = [1,2,3];
    mockScCall(mockValue);
    const res = call(addr, 'someFunc', NoArg, 0);
    expect(res).toBe(mockValue);
    });

    Parameters

    • value: StaticArray<number>

      Value returned by the mocked function

    Returns void

Generated using TypeDoc