Skip to content

Conversation

@teogeb
Copy link
Contributor

@teogeb teogeb commented Nov 15, 2024

This is a breaking changes as this changes the API

Stream instances no longer have metadata field. Instead the metadata is queried from StreamRegistry.

  • StreamRegistry already caches the metadata. Now we explicity populate the cache e.g. in searchStreams() (which queries id + metadata) from The Graph).

API

These Stream methods are now async:

  • getMetadata()
  • getPartitionCount()
  • getDescription()
  • getStorageDayCount()

Also added StreamrClient#getStreamMetadata() method which is used by Stream#getMetadata().

Testing

Added new end-to-end tests to assert cache population logic. The new ProxyHttpServer helper class which is needed by those tests.

@github-actions github-actions bot added cli-tools Related to CLI Tools Package sdk node labels Nov 15, 2024
@teogeb teogeb force-pushed the sdk-stateless-stream branch from 65e60f7 to fa8fd69 Compare November 15, 2024 18:08
@github-actions github-actions bot added the docs label Nov 15, 2024
@teogeb teogeb force-pushed the sdk-stateless-stream branch from 7a6d5ec to eb3f231 Compare November 15, 2024 19:56
@teogeb teogeb requested a review from harbu November 18, 2024 11:13
@teogeb teogeb marked this pull request as ready for review November 18, 2024 11:13
teogeb added a commit that referenced this pull request Nov 18, 2024
Moved two Ethereum function selector utils from `FakeJsonRpcServer` to
test utils. These are soon needed in
#2883.

Also refactored methods (and one `FakeJsonRpcServer` usage) to use the
`id` utils from ethers
(https://github.com/ethers-io/ethers.js/blob/9e7e7f3e2f2d51019aaa782e6290e079c38332fb/src.ts/hash/id.ts#L16).
It does the same hash calculation as our implementation.

Note that the return value of the functions now includes the `0x`
prefix. It is therefore compatible e.g. with `ethers`
`FunctionFragment.getSelector()` method
(https://github.com/ethers-io/ethers.js/blob/9e7e7f3e2f2d51019aaa782e6290e079c38332fb/src.ts/abi/fragments.ts#L1449).
@teogeb teogeb requested a review from harbu November 21, 2024 11:55
@teogeb teogeb merged commit a53f21a into main Nov 21, 2024
23 checks passed
@teogeb teogeb deleted the sdk-stateless-stream branch November 21, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli-tools Related to CLI Tools Package docs node sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants