mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
Use price as string on some remaining parts.
This commit is contained in:
parent
337c527f7d
commit
6f57118ce9
@ -36,9 +36,10 @@ describe("Consume Asset", () => {
|
||||
|
||||
it("should be able to request tokens for consumer", async () => {
|
||||
const initialBalance = (await consumer.getBalance()).ocn
|
||||
await consumer.requestTokens(metadata.base.price)
|
||||
const claimedTokens = +metadata.base.price * (10 ** -await ocean.keeper.token.decimals())
|
||||
await consumer.requestTokens(claimedTokens)
|
||||
|
||||
assert.equal((await consumer.getBalance()).ocn, initialBalance + +metadata.base.price, "OCN Tokens not delivered")
|
||||
assert.equal((await consumer.getBalance()).ocn, initialBalance + claimedTokens, "OCN Tokens not delivered")
|
||||
})
|
||||
|
||||
it("should sign the service agreement", async () => {
|
||||
|
@ -25,7 +25,7 @@ const metadata: Partial<MetaData> = {
|
||||
inLanguage: "en",
|
||||
categories: ["Economy", "Data Science"],
|
||||
tags: ["weather", "uk", "2011", "temperature", "humidity"],
|
||||
price: "10" + "0".repeat(18),
|
||||
price: "21" + "0".repeat(18),
|
||||
files: [
|
||||
{
|
||||
index: 0,
|
||||
|
@ -98,7 +98,7 @@ export class EscrowAccessSecretStoreTemplate extends AgreementTemplate {
|
||||
const accessSecretStoreConditionId = await accessSecretStoreCondition.generateIdHash(agreementId, did, consumer)
|
||||
const escrowRewardId = await escrowReward.generateIdHash(
|
||||
agreementId,
|
||||
amount,
|
||||
String(amount),
|
||||
publisher,
|
||||
consumer,
|
||||
lockRewardConditionId,
|
||||
|
Loading…
Reference in New Issue
Block a user