mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
register returns string now instead of the asset again
This commit is contained in:
parent
c690cf3465
commit
9fb6f296f3
@ -33,7 +33,7 @@ export default class Ocean {
|
||||
return ethAccounts.map((address: string) => new Account(address))
|
||||
}
|
||||
|
||||
public async register(asset: Asset): Promise<Asset> {
|
||||
public async register(asset: Asset): Promise<string> {
|
||||
const {market} = this.keeper
|
||||
|
||||
// generate an id
|
||||
@ -44,7 +44,7 @@ export default class Ocean {
|
||||
const result = await market.register(asset.getId(), asset.price, asset.publisher.getId())
|
||||
Logger.log("Registered:", assetId, "in block", result.blockNumber)
|
||||
|
||||
return asset
|
||||
return assetId
|
||||
}
|
||||
|
||||
public async getOrdersByConsumer(consumer: Account): Promise<Order[]> {
|
||||
|
@ -44,12 +44,10 @@ describe("Ocean", () => {
|
||||
|
||||
const asset = new Asset(name, description, price, publisher)
|
||||
|
||||
const finalAsset: Asset = await ocean.register(asset)
|
||||
const assetId: string = await ocean.register(asset)
|
||||
|
||||
assert(finalAsset.getId().length === 66)
|
||||
assert(finalAsset.getId().startsWith("0x"))
|
||||
assert(finalAsset.publisher === publisher)
|
||||
assert(finalAsset.price === price)
|
||||
assert(assetId.length === 66)
|
||||
assert(assetId.startsWith("0x"))
|
||||
})
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user