Examples
Examples class is meant to deploy some of the tests defined in FincontractMarketplace as well as assign Gateways to global values. It's solely for testing purposes and should be removed once the project is released.
Constructor Summary
Public Constructor | ||
public |
constructor(marketplace: FincontractMarketplace, gatewaybool: Gateway, gatewayint: Gateway, web3: Web3) Constucts the Examples object that allows for deployment of predefined tests |
Method Summary
Public Methods | ||
public |
deploy(name: String, args: String, filter: TransactionFilter, callback: Function): Promise<String, Error> Sends a transaction with proper name and arguments and starts watching for an event to happen, which is defined by filter and then triggers the the callback. |
|
public |
Sends a transaction with proper name and arguments and starts listening
to |
|
public |
runExample(name: String): Promise<String, Error> Runs a predefined function on the blockchain. |
|
public |
Runs setGatewayI and setGatewayB FincontractMarketplace functions with specified parameters as addresses to these gateways. |
Public Constructors
public constructor(marketplace: FincontractMarketplace, gatewaybool: Gateway, gatewayint: Gateway, web3: Web3) source
Constucts the Examples object that allows for deployment of predefined tests
Params:
Name | Type | Attribute | Description |
marketplace | FincontractMarketplace | a Fincontracts smart contract instance |
|
gatewaybool | Gateway | a connected GatewayBool instance |
|
gatewayint | Gateway | a connected GatewayInteger instance |
|
web3 | Web3 | a web3 instance connected to Ethereum node |
Public Methods
public deploy(name: String, args: String, filter: TransactionFilter, callback: Function): Promise<String, Error> source
Sends a transaction with proper name and arguments and starts watching for an event to happen, which is defined by filter and then triggers the the callback.
Params:
Name | Type | Attribute | Description |
name | String | name of the transaction |
|
args | String | arguments of the transaction |
|
filter | TransactionFilter | a filter object to listen for events |
|
callback | Function | a callback to be executed once event was triggered |
public deployExample(name: String, args: Array): Promise<String, Error> source
Sends a transaction with proper name and arguments and starts listening
to CreatedBy
event with callback that returns the id of newly created
Fincontract. (See Examples#deploy for more details)
public runExample(name: String): Promise<String, Error> source
Runs a predefined function on the blockchain. See FincontractMarketplace for more details.
Params:
Name | Type | Attribute | Description |
name | String | name of the test to be dpeloyed |