Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DDO: Stats and Prices for exchanges/dispensers #774

Open
wants to merge 113 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
e80245e
Create type for IndexedMetadata. Delete key when validating DDO.
mariacarmina Dec 4, 2024
06f85c3
Delete key when checks are performed for DIDs.
mariacarmina Dec 4, 2024
27075f7
fix lint.
mariacarmina Dec 4, 2024
018683d
Add stats wihtin ddo in MetadataCreated. Update logic in OrderStarted.
mariacarmina Dec 4, 2024
c091ac3
Update stats logic for OrderReused.
mariacarmina Dec 4, 2024
b2517f6
fix lint.
mariacarmina Dec 4, 2024
d40c3dd
Add backwards compatible functionality for orders keys. Will be remov…
mariacarmina Dec 4, 2024
c072e1d
Added logic for MetadataUpdated
mariacarmina Dec 5, 2024
a881255
Fix tests for orders in indexer.
mariacarmina Dec 5, 2024
0ff7e12
Fix lint.
mariacarmina Dec 5, 2024
61a2b7b
Add logs.
mariacarmina Dec 5, 2024
b21b16d
Update logic for non princing schemas ddos.
mariacarmina Dec 5, 2024
4fa035e
debug.
mariacarmina Dec 6, 2024
ab3122f
Add debug logs.
mariacarmina Dec 6, 2024
4a3da6c
Add dispenser logs.
mariacarmina Dec 6, 2024
c401204
Add more debug logs.
mariacarmina Dec 6, 2024
4d09c45
Changed condition.
mariacarmina Dec 6, 2024
9c8ce70
Fix function length.
mariacarmina Dec 6, 2024
6a4202e
Add new logic for order started and order reused.
mariacarmina Dec 6, 2024
d2185dc
Create util function for generating ddo pricings.
mariacarmina Dec 6, 2024
c0998cd
Debug DDO hashes.
mariacarmina Dec 6, 2024
b0768f0
Updated test.
mariacarmina Dec 7, 2024
1be249e
Cleanup logs.
mariacarmina Dec 7, 2024
58d4491
Implemented an util function which calculates prices for a datatoken.
mariacarmina Dec 16, 2024
72e7ead
Rename function.
mariacarmina Dec 16, 2024
b197bd0
Monitor DispenserActivated.
mariacarmina Dec 16, 2024
d37ba24
Monitor DispenserDeactivated.
mariacarmina Dec 16, 2024
716ddd1
Monitor ExchangeActivated. Added token address to all dispensers.
mariacarmina Dec 17, 2024
e15905a
Instantiate processors.
mariacarmina Dec 17, 2024
c2ab578
Added events hashes.
mariacarmina Dec 17, 2024
88efb9f
Monitor ExchangeRateChanged.
mariacarmina Dec 17, 2024
c240aed
fix lint.
mariacarmina Dec 17, 2024
fd0686a
fix lint.
mariacarmina Dec 17, 2024
ed870c8
Merge branch 'main' into feature/new-ddo-structure
mariacarmina Dec 17, 2024
6738cb3
Add pricing tests for new ddo structure.
mariacarmina Dec 19, 2024
d5d8b4f
Add debug print.
mariacarmina Dec 20, 2024
04cdf30
Added tests for dispenser, index dispenser activated.
mariacarmina Dec 20, 2024
bd9941a
Fix fre creation parameters.
mariacarmina Dec 20, 2024
f533882
Clean up.
mariacarmina Dec 20, 2024
71c5a7a
Changed parameter name.
mariacarmina Dec 20, 2024
95e006f
Changed address.
mariacarmina Dec 20, 2024
223e38b
Fix mint on fre, updated dispenser params.
mariacarmina Dec 20, 2024
e3c2c71
Add more asserts for fre test.
mariacarmina Jan 8, 2025
cb9faa3
Run only pricing tests.
mariacarmina Jan 9, 2025
4ca1a56
Fix parameters for fre.
mariacarmina Jan 9, 2025
f018460
Add print for resolved DDO and for exchange ID.
mariacarmina Jan 9, 2025
824c2a9
debug.
mariacarmina Jan 9, 2025
8576ff3
Increase timeout.
mariacarmina Jan 9, 2025
3d092bc
Add debug logs for event decoded data.
mariacarmina Jan 9, 2025
0b536f5
fix logs.
mariacarmina Jan 9, 2025
230995c
Monitor ExchangeCreated event.
mariacarmina Jan 9, 2025
29a9b5e
tweak.
mariacarmina Jan 11, 2025
6121498
Fixed event name.
mariacarmina Jan 11, 2025
5320ef5
Changed event hash.
mariacarmina Jan 11, 2025
1ce17eb
Merge branch 'main' into feature/new-ddo-structure
mariacarmina Jan 18, 2025
0cc3b76
Undo event hash.
mariacarmina Jan 18, 2025
a62cd2e
Add logs.
mariacarmina Jan 18, 2025
e5f0058
Changed event hash.
mariacarmina Jan 18, 2025
7f5ac90
add debug logs.
mariacarmina Jan 18, 2025
7f9bf9b
Decode data.
mariacarmina Jan 18, 2025
4901ba1
Added more logs.
mariacarmina Jan 18, 2025
0ca4cf2
Fixed decodeEvent fn.
mariacarmina Jan 18, 2025
d20559b
fix loop, fix log.
mariacarmina Jan 18, 2025
a5f37f8
more logs.
mariacarmina Jan 18, 2025
df754fb
Added dispenser tests.
mariacarmina Jan 18, 2025
bdca794
Fixed exchange ID retrieval. cleanup debug logs.
mariacarmina Jan 18, 2025
3df093c
Add debug logs for MetadataProcessor.
mariacarmina Jan 19, 2025
6421e76
add more debug logs for getTokenInfo.
mariacarmina Jan 19, 2025
0f8d089
Fix getTokenInfo function.
mariacarmina Jan 19, 2025
1b2aadb
Added checks for invalid datatoken address, fix tests.
mariacarmina Jan 19, 2025
a22a220
Added debug logs for instantiating contracts.
mariacarmina Jan 20, 2025
67207ce
Fix fixedRate return params retrieval.
mariacarmina Jan 20, 2025
4768bc6
tweak.
mariacarmina Jan 20, 2025
1d852f3
Refactor dispenser tests.
mariacarmina Jan 20, 2025
0c0ea2f
More asserts for FRE and debug prices. Logs for dispenser.
mariacarmina Jan 20, 2025
a8954c0
Add function which checks event hash in logs topics.
mariacarmina Jan 20, 2025
cf26cd0
logs.
mariacarmina Jan 20, 2025
3325834
debug.
mariacarmina Jan 20, 2025
16d01cd
tweaks.
mariacarmina Jan 20, 2025
5c709b8
Added assertion asserts.
mariacarmina Jan 20, 2025
046d8fa
Fix test.
mariacarmina Jan 20, 2025
f9c3e94
debug logs.
mariacarmina Jan 20, 2025
f5afad9
Fix event.
mariacarmina Jan 20, 2025
2a9437b
Fix dispenser test.
mariacarmina Jan 20, 2025
ee26781
print datatoken address.
mariacarmina Jan 20, 2025
3c394cf
to lowercase
mariacarmina Jan 20, 2025
9e3ad98
debug
mariacarmina Jan 20, 2025
97f4ed5
to lowercase.
mariacarmina Jan 20, 2025
ba45b39
tweak test.
mariacarmina Jan 20, 2025
c71c9f6
Get stats w dispenser only.
mariacarmina Jan 20, 2025
44e4471
Updated event to index.
mariacarmina Jan 20, 2025
6163a5e
brig test suite back.
mariacarmina Jan 20, 2025
129e7a2
Parse uints correctly w ethers.
mariacarmina Jan 21, 2025
26026ce
fix tests.
mariacarmina Jan 21, 2025
27aba77
Fix function call.
mariacarmina Jan 21, 2025
a96d228
Added checks.
mariacarmina Jan 22, 2025
e005f5a
Uncommented activate function.
mariacarmina Jan 22, 2025
4093acc
Added new datatoken with dispenser.
mariacarmina Jan 23, 2025
be5907e
Remove activate function.
mariacarmina Jan 23, 2025
1d14643
Monitor metadata updated.
mariacarmina Jan 23, 2025
42d61b0
Added new service.
mariacarmina Jan 23, 2025
00ab6d3
Fix status contract call w dt address.
mariacarmina Jan 26, 2025
6724edd
Update prices for dispenser.
mariacarmina Jan 26, 2025
c2524d1
Add debug logs.
mariacarmina Jan 26, 2025
38eb26a
Deactivate dispenser.
mariacarmina Jan 26, 2025
2409030
fix asserts.
mariacarmina Jan 26, 2025
31235a4
debug log.
mariacarmina Jan 26, 2025
fc06d85
Use getAddress.
mariacarmina Jan 26, 2025
0d8bd13
cleanup + add tests back.
mariacarmina Jan 26, 2025
fe7cf1d
try with new cli branch.
mariacarmina Jan 26, 2025
d2e231c
Test only pricing.
mariacarmina Jan 26, 2025
6eb90fd
Updated DDO integration tests.
mariacarmina Jan 27, 2025
e5b4f3d
Increase indexing time.
mariacarmina Jan 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ jobs:
with:
repository: 'oceanprotocol/ocean-cli'
path: 'ocean-cli'
ref: 'main'
ref: 'fix-tests-for-new-ddo'
- name: Setup Ocean CLI
working-directory: ${{ github.workspace }}/ocean-cli
run: |
Expand Down
3 changes: 3 additions & 0 deletions src/@types/DDO/DDO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Service } from './Service'
import { Metadata } from './Metadata'
import { Credentials } from './Credentials'
import { Event } from './Event'
import { IndexedMetadata } from './IndexedMetadata'
import { Nft } from './Nft'

/**
Expand Down Expand Up @@ -67,4 +68,6 @@ export interface DDO {
event?: Event

nft?: Nft

indexedMetadata?: IndexedMetadata
}
19 changes: 19 additions & 0 deletions src/@types/DDO/IndexedMetadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export interface Price {
type: string
price: string
contract: string
token?: string
exchangeId?: string
}

export interface Stats {
datatokenAddress: string
name: string
serviceId: string
orders?: number
prices?: Price[]
}

export interface IndexedMetadata {
stats: Stats[]
}
7 changes: 6 additions & 1 deletion src/components/Indexer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ export class OceanIndexer {
EVENTS.METADATA_UPDATED,
EVENTS.METADATA_STATE,
EVENTS.ORDER_STARTED,
EVENTS.ORDER_REUSED
EVENTS.ORDER_REUSED,
EVENTS.DISPENSER_ACTIVATED,
EVENTS.DISPENSER_DEACTIVATED,
EVENTS.EXCHANGE_ACTIVATED,
EVENTS.EXCHANGE_DEACTIVATED,
EVENTS.EXCHANGE_RATE_CHANGED
].includes(event.method)
) {
// will emit the metadata created/updated event and advertise it to the other peers (on create only)
Expand Down
Loading
Loading