mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Remove --no-acl-contract
flag.
This commit is contained in:
parent
b821d6c6e0
commit
f3599a5d7f
@ -23,7 +23,7 @@ before_script:
|
||||
- cd barge
|
||||
- export KEEPER_VERSION=v0.8.5
|
||||
- export KEEPER_OWNER_ROLE_ADDRESS="0xe2DD09d719Da89e5a3D0F2549c7E24566e947260"
|
||||
- bash -x start_ocean.sh --latest --no-pleuston --local-spree-node --no-acl-contract 2>&1 > start_ocean.log &
|
||||
- bash -x start_ocean.sh --latest --no-pleuston --local-spree-node 2>&1 > start_ocean.log &
|
||||
- cd ..
|
||||
- ./scripts/unlock-spree-accounts.sh 2>&1 > /dev/null &
|
||||
|
||||
|
@ -6,6 +6,6 @@
|
||||
"secretStoreUri": "http://localhost:12001",
|
||||
"threshold": 0,
|
||||
"password": "secret",
|
||||
"address": "0xa99d43d86a0758d5632313b8fa3972b6088a21bb",
|
||||
"address": "0x068Ed00cF0441e4829D9784fCBe7b9e26D4BD8d0",
|
||||
"verbose": 0
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { assert } from "chai"
|
||||
import * as Web3 from "web3"
|
||||
import * as fs from "fs"
|
||||
|
||||
import { config } from "../config"
|
||||
@ -18,12 +19,17 @@ describe("Consume Asset", () => {
|
||||
let serviceAgreementSignatureResult: {agreementId: string, signature: string}
|
||||
|
||||
before(async () => {
|
||||
ocean = await Ocean.getInstance(config)
|
||||
ocean = await Ocean.getInstance({
|
||||
...config,
|
||||
web3Provider: new Web3.providers
|
||||
.HttpProvider("http://localhost:8545", 0, "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e", "node0"),
|
||||
})
|
||||
|
||||
// Accounts
|
||||
publisher = (await ocean.accounts.list())[0]
|
||||
publisher.setPassword(process.env.ACCOUNT_PASSWORD)
|
||||
consumer = (await ocean.accounts.list())[1]
|
||||
publisher = new Account("0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e")
|
||||
publisher.setPassword("node0")
|
||||
consumer = new Account("0x068Ed00cF0441e4829D9784fCBe7b9e26D4BD8d0")
|
||||
consumer.setPassword("secret")
|
||||
})
|
||||
|
||||
it("should regiester a asset", async () => {
|
||||
@ -67,7 +73,7 @@ describe("Consume Asset", () => {
|
||||
assert.isTrue(success)
|
||||
})
|
||||
|
||||
it("should lock the payment", async () => {
|
||||
it("should lock the payment by the consumer", async () => {
|
||||
const paid = await ocean.agreements.conditions
|
||||
.lockReward(
|
||||
serviceAgreementSignatureResult.agreementId,
|
||||
@ -78,7 +84,7 @@ describe("Consume Asset", () => {
|
||||
assert.isTrue(paid, "The asset has not been paid correctly")
|
||||
})
|
||||
|
||||
it("should grant the access", async () => {
|
||||
it("should grant the access by the publisher", async () => {
|
||||
const granted = await ocean.agreements.conditions
|
||||
.grantAccess(serviceAgreementSignatureResult.agreementId, ddo.id, consumer.getId(), publisher)
|
||||
|
||||
|
@ -28,7 +28,8 @@ describe("Secret Store", () => {
|
||||
assert.match(encryptedContent, /^0x[a-f0-9]{86}$/i)
|
||||
})
|
||||
|
||||
it("should decrypt a text", async () => {
|
||||
// Only works running Barge with `--no-acl-contract`
|
||||
xit("should decrypt a text", async () => {
|
||||
const decryptedContent = await ocean.secretStore.decrypt(did.getId(), encryptedContent, account)
|
||||
|
||||
assert.deepEqual(decryptedContent, content)
|
||||
|
@ -8,7 +8,7 @@ export class AccessSecretStoreCondition extends Condition {
|
||||
}
|
||||
|
||||
public hashValues(did: string, grantee: string) {
|
||||
return super.hashValues(zeroX(did), zeroX(grantee))
|
||||
return super.hashValues(didZeroX(did), zeroX(grantee))
|
||||
}
|
||||
|
||||
public fulfill(agreementId: string, did: string, grantee: string, from?: string) {
|
||||
|
@ -193,7 +193,9 @@ export default class OceanAssets {
|
||||
}
|
||||
|
||||
Logger.log("Decrypting files")
|
||||
const decryptedFiles = await SecretStoreProvider.getSecretStore(secretStoreConfig).decryptDocument(DID.parse(did).getId(), files)
|
||||
const decryptedFiles = await SecretStoreProvider
|
||||
.getSecretStore(secretStoreConfig)
|
||||
.decryptDocument(DID.parse(did).getId(), files)
|
||||
Logger.log("Files decrypted")
|
||||
|
||||
Logger.log("Consuming files")
|
||||
|
Loading…
Reference in New Issue
Block a user