Function mockAdminContext

  • Changes wether the testing context is has all privileges or not by giving the write access to all contracts

    Remarks

    This function is used to test write access protected smart contract functions.

    Example

    test('test protected function', () => {
    mockAdminContext(true);

    const mockValue: StaticArray<u8> = [1,2,3];
    const res = myProtectedSCFunc(NoArgs.serialize());

    expect(res).toBe(mockValue);
    });

    Parameters

    • isAdmin: bool

      true to give write access, false otherwise

    Returns void

Generated using TypeDoc