TESTNitroAdjudicator.sol

View Source: contracts/test/TESTNitroAdjudicator.sol

โ†— Extends: NitroAdjudicator, TESTForceMove

This contract extends the NitroAdjudicator contract to enable it to be more easily unit-tested. It exposes public or external functions that set storage variables or wrap otherwise internal functions. It should not be deployed in a production environment.


Functions


setHoldings

Manually set the holdings mapping to a given amount for a given channelId. Shortcuts the deposit workflow (ONLY USE IN A TESTING ENVIRONMENT)

function setHoldings(address asset, bytes32 channelId, uint256 amount) external nonpayable

Arguments

NameTypeDescription
assetaddress
channelIdbytes32Unique identifier for a state channel.
amountuint256The number of assets that should now be "escrowed: against channelId

isExternalDestination

Wrapper for otherwise internal function. Checks if a given destination is external (and can therefore have assets transferred to it) or not.

function isExternalDestination(bytes32 destination) public pure
returns(bool)

Returns

True if the destination is external, false otherwise.

Arguments

NameTypeDescription
destinationbytes32Destination to be checked.

addressToBytes32

Wrapper for otherwise internal function. Converts an ethereum address to a nitro external destination.

function addressToBytes32(address participant) public pure
returns(bytes32)

Returns

The input address left-padded with zeros.

Arguments

NameTypeDescription
participantaddressThe address to be converted.
Last updated on by geoknee