1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

removed Auth contract

This commit is contained in:
Pedro Gutiérrez 2019-01-28 15:42:59 +01:00 committed by Pedro Gutiérrez
parent fc46592fe9
commit 3364feb9dd
3 changed files with 0 additions and 46 deletions

View File

@ -1,4 +1,3 @@
import OceanAuth from "./contracts/Auth"
import AccessConditions from "./contracts/conditions/AccessConditions" import AccessConditions from "./contracts/conditions/AccessConditions"
import PaymentConditions from "./contracts/conditions/PaymentConditions" import PaymentConditions from "./contracts/conditions/PaymentConditions"
import DIDRegistry from "./contracts/DIDRegistry" import DIDRegistry from "./contracts/DIDRegistry"
@ -27,7 +26,6 @@ export default class Keeper {
Keeper.instance = new Keeper() Keeper.instance = new Keeper()
Keeper.instance.dispenser = await Dispenser.getInstance() Keeper.instance.dispenser = await Dispenser.getInstance()
Keeper.instance.auth = await OceanAuth.getInstance()
Keeper.instance.token = await OceanToken.getInstance() Keeper.instance.token = await OceanToken.getInstance()
Keeper.instance.serviceAgreement = await ServiceExecutionAgreement.getInstance() Keeper.instance.serviceAgreement = await ServiceExecutionAgreement.getInstance()
Keeper.instance.accessConditions = await AccessConditions.getInstance() Keeper.instance.accessConditions = await AccessConditions.getInstance()
@ -55,12 +53,6 @@ export default class Keeper {
*/ */
public dispenser: Dispenser public dispenser: Dispenser
/**
* Ocean Auth smart contract instance.
* @type {OceanAuth}
*/
public auth: OceanAuth
/** /**
* Service agreement smart contract instance. * Service agreement smart contract instance.
* @type {ServiceExecutionAgreement} * @type {ServiceExecutionAgreement}

View File

@ -1,34 +0,0 @@
import {Receipt} from "web3-utils"
import AccessStatus from "../../models/AccessStatus"
import ContractBase from "./ContractBase"
export default class OceanAuth extends ContractBase {
public static async getInstance(): Promise<OceanAuth> {
const auth: OceanAuth = new OceanAuth("OceanAuth")
await auth.init()
return auth
}
public async getOrderStatus(orderId: string): Promise<AccessStatus> {
return this.call("statusOfAccessRequest", [orderId])
.then((status: string) => {
const statusInt = parseInt(status, 10)
const statusString = AccessStatus[statusInt]
return AccessStatus[statusString]
})
}
public async getEncryptedAccessToken(orderId: string, consumerAddress: string): Promise<Receipt> {
return this.call("getEncryptedAccessToken", [orderId], consumerAddress)
}
public async getTempPubKey(orderId: string) {
return this.call("getTempPubKey", [orderId])
}
public async deliverAccessToken(orderId: string, accessToken: string, publisherAddress: string) {
return this.send("deliverAccessToken", publisherAddress, [orderId, accessToken])
}
}

View File

@ -20,10 +20,6 @@ describe("Keeper", () => {
assert(keeper.dispenser !== null) assert(keeper.dispenser !== null)
}) })
it("should have auth", () => {
assert(keeper.auth !== null)
})
it("should have token", () => { it("should have token", () => {
assert(keeper.token !== null) assert(keeper.token !== null)
}) })