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

Use Oracle Program in user facing interfaces and outputs #99

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

Thomasvdam
Copy link
Member

@Thomasvdam Thomasvdam commented Sep 24, 2024

BREAKING CHANGE: renames a lot of methods and commands

Motivation

While changing the name across all repos is too much effort right now, we can at least kind of future proof the user facing parts of the dev tools so that the transition won't impact them as much.

Explanation of Changes

Renamed most instances of WASM binary, DR binary, wasm, etc to Oracle Program and Oracle Program ID.

Testing

Tests in the repository still work.

Also tested packaging @seda-protocol/dev-tools and @seda-protocol/vm locally with npm pack and installing that in the seda-request-starter-kit.

CLI still works:

Upload:

$ bun run libs/dev-tools/bin/index.js oracle-program upload ./dist/libs/as-sdk-integration-tests/debug.wasm
✔ Uploading Oracle Program to the SEDA network

┌─────────────────┬────────────────────────────────────────────────────────────────────┐
│ (index)         │ Values                                                             │
├─────────────────┼────────────────────────────────────────────────────────────────────┤
│ tx              │ '4702593A69CB562572526CA87CA927654EE3FABDCDF7C95CB2C404B265CD9BE4' │
│ oracleProgramId │ '605244b203c3039b0c3d61821cf9147f4c76fa137054ac72c74d6f1a6864e56b' │
└─────────────────┴────────────────────────────────────────────────────────────────────┘

Show

$ bun run libs/dev-tools/bin/index.js oracle-program show 033890ea4ea08b1f378744ee44a45069999d9f4c91c1076f0e7bca12ce276403
✔ Querying Oracle Program from the SEDA network

┌──────────────────┬────────────────────────────────────────────────────────────────────┐
│ (index)          │ Values                                                             │
├──────────────────┼────────────────────────────────────────────────────────────────────┤
│ oracleProgramId  │ '033890ea4ea08b1f378744ee44a45069999d9f4c91c1076f0e7bca12ce276403' │
│ addedAt          │                                                                    │
│ expirationHeight │ 0                                                                  │
└──────────────────┴────────────────────────────────────────────────────────────────────┘

List:

$ bun run libs/dev-tools/bin/index.js oracle-program list
✔ Querying Oracle Programs from the SEDA network

┌─────────┬────────────────────────────────────────────────────────────────────┬──────────────────┐
│ (index) │ oracleProgramId                                                    │ expirationHeight │
├─────────┼────────────────────────────────────────────────────────────────────┼──────────────────┤
│ 0       │ '033890ea4ea08b1f378744ee44a45069999d9f4c91c1076f0e7bca12ce276403''0'              │
│ 1       │ '07b93310867ac382e63c3f35797ae0f5334d0b276b420feda53165b9efa97795''0'              │
│ 2       │ '201f166941e9570a03def9a2b497851706154c201f1cd1f0609422c33ebd8b6c''0'              │
│ 3       │ '228db98bd49b5903b4a6d31d08980ba5e280ab3ec7c1a84dfac400bda68150cb''0'              │
│ 4       │ '23bc4915d1011d0d67af8e9de9d06867fb7b8b8580e243887f40f0f306571662''0'              │
│ 5       │ '2e13b2cf540b898edee7a0ed61ee15532036dad447212e7d0a5580e0e5103584''0'              │
│ 6       │ '3f09f88cae87e969d906bbba7e2b61c3899aabb92589766fa1e84104e58e39f0''0'              │
│ 7       │ '470fca08d461761f16d42a357d04732524c85f00e32e0360a246a9396a9d2fc0''0'              │
│ 8       │ '6bc458a34249c18884a9ade73e25e1dbc8c08b37448918f56f03ebf8241330cb''0'              │
│ 9       │ '6f9d5481c29ca49eca57a49732db99d2a7a348eb6e27e3632c6613a08246963f''0'              │
│ 10      │ '79412da1e08c23a41d77ce727f2965f568f6c03126add6eb3363fb99569b5344''0'              │
│ 11      │ '7a4685b50cca15b24e70792fbc4701975e421de890342a413ef3f846b3e5dbc1''0'              │
│ 12      │ '8041b318bc64ca2d2b2493f03fe2037e8a3d808ee12d957df959d1bea3495932''0'              │
│ 13      │ '83b47be61395b5d5b60fce69ce06604c550a23314ea744b091480a68199c4a2f''0'              │
│ 14      │ '86d5c8063a79da3a0037959010b163c5ea27757da3920635ac1d18c608c053bc''0'              │
│ 15      │ '9299fc773c70298971f9d2df781e6c52033a1faca7fd34f978c38ea98e3fb881''0'              │
│ 16      │ 'ab400f815773cfa157650643b988aa590487537133643e370b39b8b3f2f30c84''0'              │
│ 17      │ 'cb5e4f2e5bb73dc09891eb9cd01fda68c69c5059f512d8e66fc0ed461b91b3d4''0'              │
│ 18      │ 'd48cc83c64392f189abdcadc06bd11d28e178b88808b219f9b9bc6c8c2ce0a9f''0'              │
│ 19      │ 'eb72a07725ab5f1d8bad5b88b933c2860aaa71d5f69d89ffbca44502a7178ce2''0'              │
└─────────┴────────────────────────────────────────────────────────────────────┴──────────────────┘

Without action:

$ bun run libs/dev-tools/bin/index.js oracle-program
Usage: index oracle-program [options] [command]

commands to list, show, and upload Oracle Programs

Options:
  -h, --help                        display help for command

Commands:
  upload [options] <wasm-filepath>  upload an Oracle Program to the SEDA chain.
  list                              list existing Oracle Programs in the SEDA chain
  show <oracle-program-id>          show an Oracle Program in the SEDA chain
  help [command]                    display help for command
error: "index.js" exited with code 1
error: script "cli" exited with code 1

Related PRs and Issues

Part-of: https://github.com/sedaprotocol/seda-internal/issues/141

Copy link
Member

@mariocao mariocao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the "added at" row from $ bun run libs/dev-tools/bin/index.js oracle-program show <ID> always empty?
If so, we should remove it.

@Thomasvdam Thomasvdam marked this pull request as ready for review September 24, 2024 12:11
@Thomasvdam
Copy link
Member Author

@mariocao I removed the output, I think it's never set by the chain right now.

@Thomasvdam Thomasvdam changed the title Use Oracle Program in user facing interfaces and ouputs Use Oracle Program in user facing interfaces and outputs Sep 24, 2024
Copy link
Member

@mariocao mariocao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure that the docs at seda.xyz are also updated.

@Thomasvdam Thomasvdam merged commit f9c7fc3 into main Sep 24, 2024
1 check passed
@Thomasvdam Thomasvdam deleted the feat/rename-wasm-binary branch September 24, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants