mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Add authenticate method to account.
This commit is contained in:
parent
b32f708385
commit
95d668666b
|
@ -68,7 +68,7 @@ describe("Authentication Token", () => {
|
||||||
assert.isFalse(acc2Stored)
|
assert.isFalse(acc2Stored)
|
||||||
assert.isFalse(await account2.isTokenStored())
|
assert.isFalse(await account2.isTokenStored())
|
||||||
|
|
||||||
await ocean.auth.store(account2)
|
await account2.authenticate()
|
||||||
|
|
||||||
acc2Stored = await ocean.auth.isStored(account2)
|
acc2Stored = await ocean.auth.isStored(account2)
|
||||||
assert.isTrue(acc2Stored)
|
assert.isTrue(acc2Stored)
|
||||||
|
|
|
@ -25,6 +25,17 @@ describe("Consume Asset (Brizo)", () => {
|
||||||
consumer = (await ocean.accounts.list())[1]
|
consumer = (await ocean.accounts.list())[1]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
after(() => {
|
||||||
|
try {
|
||||||
|
localStorage.clear()
|
||||||
|
} catch { }
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should authenticate the accounts", async () => {
|
||||||
|
await publisher.authenticate()
|
||||||
|
await consumer.authenticate()
|
||||||
|
})
|
||||||
|
|
||||||
it("should regiester an asset", async () => {
|
it("should regiester an asset", async () => {
|
||||||
const steps = []
|
const steps = []
|
||||||
ddo = await ocean.assets.create(metadata as any, publisher)
|
ddo = await ocean.assets.create(metadata as any, publisher)
|
||||||
|
|
|
@ -65,6 +65,13 @@ export default class Account extends Instantiable {
|
||||||
return this.ocean.auth.isStored(this)
|
return this.ocean.auth.isStored(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Authenticate the account.
|
||||||
|
*/
|
||||||
|
public authenticate() {
|
||||||
|
return this.ocean.auth.store(this)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Balance of Ocean Token.
|
* Balance of Ocean Token.
|
||||||
* @return {Promise<number>}
|
* @return {Promise<number>}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user