Function setDeployContext

  • Emulate a deployment context by giving the write access to called contract. If callerAddress is not passed, uses the current call stack caller address as the caller address. If callerAddress is passed, the call stack will be updated to have the given address as the caller address.

    Example

    test('test constructor function', () => {
    setDeployContext();

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

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

    Parameters

    • Optional callerAddress: string

      the optional caller address to use for the deployment emulation

    Returns void

Generated using TypeDoc