Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions src/abstractWrappers/AbstractWrapper.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/abstractWrappers/index.js

This file was deleted.

20 changes: 10 additions & 10 deletions src/constants/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ export const PROFILE_NOT_FOUND = user => `No profile found for user: ${user}.`
export const NOTIFICATION_NOT_FOUND = txHash =>
`No notification with txHash ${txHash} exists.`

// ContractWrapper
// Contracts
export const UNABLE_TO_DEPLOY_CONTRACT =
'Unable to deploy contract, are you sure the contract artifact is correct?'
export const CONTRACT_NOT_DEPLOYED =
'Unable to load contract. Are you sure the contract is deployed and you are on the right network?'
export const UNABLE_TO_LOAD_CONTRACT =
'Unable to load contract. Are you sure the contract artifact is correct?'

// StatefulContractWrapper
// Implementation
export const CONTRACT_INSTANCE_NOT_SET =
'No contract instance. Use setContractInstance'

// PinakionWrapper
// PinakionPOC
export const UNABLE_TO_SET_KLEROS = 'Unable to set Kleros.'
export const UNABLE_TO_TRANSFER_OWNERSHIP = 'Unable to transfer ownership.'

// KlerosWrapper
// KlerosPOC
export const UNABLE_TO_BUY_PNK =
'Unable to buy PNK, are you sure you have enough ETH?'
export const UNABLE_TO_ACTIVATE_PNK =
Expand All @@ -45,7 +45,7 @@ export const PERIOD_OUT_OF_RANGE = periodNumber =>
export const DISPUTE_DOES_NOT_EXIST = disputeId =>
`Dispute ${disputeId} does not exist`

// ArbitrableTransactionWrapper
// ArbitrableTransaction
export const UNABLE_TO_PAY_ARBITRATION_FEE =
'Unable to pay fee, are you sure you have enough PNK?'
export const UNABLE_TO_PAY_SELLER =
Expand All @@ -56,11 +56,11 @@ export const CONTRACT_IS_NOT_WAITING_ON_OTHER_PARTY =
export const TIMEOUT_NOT_REACHED =
'Unable to call timeout, because it has not been reached yet.'

// AbstractWrapper
export const NO_ARBITRATOR_WRAPPER_SPECIFIED =
'No Arbitrator Contract Wrapper specified. Please call setArbitrator.'
export const NO_ARBITRABLE_WRAPPER_SPECIFIED =
'No Arbitrable Contract Wrapper specified. Please call setArbitrable.'
// AbstractContract
export const NO_ARBITRATOR_IMPLEMENTATION_SPECIFIED =
'No Arbitrator Contract Implementation specified. Please call setArbitrator.'
export const NO_ARBITRABLE_IMPLEMENTATION_SPECIFIED =
'No Arbitrable Contract Implementation specified. Please call setArbitrable.'
export const NO_STORE_PROVIDER_SPECIFIED =
'No Store Provider Specified. Please call setStoreProvider'

Expand Down
103 changes: 0 additions & 103 deletions src/contractWrappers/ContractWrapper.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/contractWrappers/PNK/index.js

This file was deleted.

57 changes: 0 additions & 57 deletions src/contractWrappers/RNG/BlockHashRNG/index.js

This file was deleted.

76 changes: 0 additions & 76 deletions src/contractWrappers/arbitrator/StatefulContractWrapper.js

This file was deleted.

6 changes: 0 additions & 6 deletions src/contractWrappers/index.js

This file was deleted.

32 changes: 32 additions & 0 deletions src/contracts/AbstractContract.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import _ from 'lodash'

import isRequired from '../utils/isRequired'
import delegateCalls from '../utils/delegateCalls'

class AbstractContract {
/**
* AbstractContract wraps an implementation instance to provide access to higher level
* services such as an off chain store, as well as the functionality of the underlying
* implementation.
* @param {object} implementationInstance - Contract Implementation object to extend
* @param {object} storeProviderWrapperInstance - StoreProvider wrapper object.
*/
constructor(
implementationInstance = isRequired('implementationInstance'),
storeProviderWrapperInstance = isRequired('storeProviderWrapperInstance')
) {
this._StoreProvider = storeProviderWrapperInstance
this._contractImplementation = implementationInstance
delegateCalls(this, implementationInstance)
}

/**
* Set the store wrapper
* @param {object} storeProviderWrapperInstance wrapper for store
*/
setStoreProvider = storeProviderWrapperInstance => {
this._StoreProvider = storeProviderWrapperInstance
}
}

export default AbstractContract
Loading