Removing arrary from providerFee

This commit is contained in:
Jamie Hewitt 2022-07-04 11:14:24 +01:00
parent e8d5dcf9db
commit 3dac319c0e
3 changed files with 21 additions and 15 deletions

View File

@ -265,7 +265,7 @@ type Order @entity {
publishingMarket: User
publishingMarketToken: Token #
publishingMarketAmmount: BigDecimal #call contract to get fee amount
providerFee: [String!]
providerFee: String
consumerMarket: User
consumerMarketToken: Token #

View File

@ -214,12 +214,7 @@ export function handleProviderFee(event: ProviderFee): void {
}
}`
let existingProviderFees: string[]
if (!order.providerFee) existingProviderFees = []
else existingProviderFees = order.providerFee as string[]
existingProviderFees.push(providerFee)
order.providerFee = existingProviderFees
order.providerFee = providerFee
order.save()
}

View File

@ -72,16 +72,27 @@ const ddo = {
}
describe('Simple Publish & consume test', async () => {
const nft = new Nft(web3)
const Factory = new NftFactory(addresses.ERC721Factory, web3)
const accounts = await web3.eth.getAccounts()
const publisherAccount = accounts[0]
const newOwnerAccount = accounts[1].toLowerCase()
const user1 = accounts[2]
const user2 = accounts[3]
const user3 = accounts[4]
let datatokenAddress: string
let datatoken: Datatoken
let nft: Nft
let Factory: NftFactory
let accounts: string[]
let publisherAccount: string
let newOwnerAccount: string
let user1: string
let user2: string
let user3: string
before(async () => {
nft = new Nft(web3)
Factory = new NftFactory(addresses.ERC721Factory, web3)
accounts = await web3.eth.getAccounts()
publisherAccount = accounts[0]
newOwnerAccount = accounts[1].toLowerCase()
user1 = accounts[2]
user2 = accounts[3]
user3 = accounts[4]
})
it('should publish a dataset (create NFT + ERC20)', async () => {
// const consumerAccount = accounts[1]