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

[Rpc endpoint] Bug fixes #911

Merged
merged 10 commits into from
Jul 30, 2024
Merged

[Rpc endpoint] Bug fixes #911

merged 10 commits into from
Jul 30, 2024

Conversation

jeesunikim
Copy link
Contributor

@jeesunikim jeesunikim commented Jul 15, 2024

Fixes following bugs:

  1. Fix getTransactions page (slack link)
  2. Fix sendTransaction and simulateTransaction to include tx xdr param (slack link)
  3. Make textbox bigger for payload
  4. add z-index: 2 for the network selector
    network-selector-before-after

@stellar-jenkins
Copy link

@janewang janewang requested a review from fnando July 16, 2024 21:10
@stellar-jenkins
Copy link

1 similar comment
@stellar-jenkins
Copy link

Copy link
Contributor

@quietbits quietbits left a comment

Choose a reason for hiding this comment

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

A couple of notes:

  1. getTransactions: Should we nest limit and cursor under pagination according to the docs?
  2. simulateTransaction: Submit should be disabled if there's an error in optional inputs.

image

@stellar-jenkins
Copy link

@janewang
Copy link
Contributor

janewang commented Jul 25, 2024

Screenshot 2024-07-24 at 10 48 49 PM

getTransactions startLedger and pagination limit are integers, not string of integers. Also a pagination object that wraps cursor and limit is missing.

curl -X POST \
-H 'Content-Type: application/json' \
-d '{
  "jsonrpc": "2.0",
  "id": 8675309,
  "method": "getTransactions",
  "params": {
    "startLedger": 1888539, // int
    "pagination": {
     "cursor": "string" // string
      "limit": 5 // int
    }
  }
}' \
https://soroban-testnet.stellar.org:443 | jq

@janewang
Copy link
Contributor

janewang commented Jul 25, 2024

Screenshot 2024-07-24 at 11 02 51 PM

For getEvents, startLedger is an int. cursor and limit are part of the pagination object. Limit is an int not a string. See pagination at the bottom.

curl -X POST \
-H 'Content-Type: application/json' \
-d '{
  "jsonrpc": "2.0",
  "id": 8675309,
  "method": "getEvents",
  "params": {
    "startLedger": 1190000,
    "filters": [
      {
        "type": "contract",
        "contractIds": [
          "CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC"
        ],
        "topics": [
          [
            "AAAADwAAAAh0cmFuc2Zlcg==",
            "*",
            "*",
            "*"
          ]
        ]
      }
    ],
    "pagination": {
      "limit": 2
    }
  }
}' \
https://soroban-testnet.stellar.org:443 | jq

Cannot input topics. Accepts an array, but got a string of array. Also slashes will need to be sanitized
Screenshot 2024-07-24 at 11 08 20 PM

@jeesunikim jeesunikim requested a review from quietbits July 25, 2024 04:13
@stellar-jenkins
Copy link

@janewang
Copy link
Contributor

janewang commented Jul 25, 2024

Thanks for the updates!

For getTransactions, the field that says Ledger Sequence probably should say Start Ledger Sequence

This curl works on the terminal but is not able to be entered into getTransactions screen on Lab due to required field on Start Ledger Sequence.

curl -X POST \
-H 'Content-Type: application/json' \
-d '{
  "jsonrpc": "2.0",
  "id": 8675309,
  "method": "getTransactions",
  "params": {
    "pagination": {
      "cursor": "3086346319040513",
      "limit": 5
    }
  }
}' \
https://soroban-testnet.stellar.org:443 | jq

The UI only allows me to use startLedger and limit to paginate, not able to use cursor and limit together to paginate.

Btw, I also filed a ticket on stellar docs to fix this incorrect description stellar/stellar-docs#826

@janewang
Copy link
Contributor

Screenshot 2024-07-25 at 11 10 20 AM

For simulateTransaction instruction Leeway is an int not a string.

curl -X POST \
-H 'Content-Type: application/json' \
-d '{
  "jsonrpc": "2.0",
  "id": 8675309,
  "method": "simulateTransaction",
  "params": {
    "transaction": "AAAAAgAAAAAg4dbAxsGAGICfBG3iT2cKGYQ6hK4sJWzZ6or1C5v6GAAAAGQAJsOiAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAGAAAAAAAAAABzAP+dP0PsNzYvFF1pv7a8RQXwH5eg3uZBbbWjE9PwAsAAAAJaW5jcmVtZW50AAAAAAAAAgAAABIAAAAAAAAAACDh1sDGwYAYgJ8EbeJPZwoZhDqEriwlbNnqivULm/oYAAAAAwAAAAMAAAAAAAAAAAAAAAA=",
    "resourceConfig": {
      "instructionLeeway": 3000000
    }
  }
}' \
https://soroban-testnet.stellar.org:443 | jq

@jeesunikim jeesunikim force-pushed the rpc-endpoint-bug-fix branch from cdb54aa to 3453e72 Compare July 30, 2024 00:24
@jeesunikim jeesunikim requested a review from quietbits July 30, 2024 00:27
@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

@jeesunikim jeesunikim requested a review from quietbits July 30, 2024 17:32
@stellar-jenkins
Copy link

@jeesunikim jeesunikim merged commit b8da7cd into laboratory-v2 Jul 30, 2024
3 checks passed
@jeesunikim jeesunikim deleted the rpc-endpoint-bug-fix branch July 30, 2024 20:57
quietbits added a commit that referenced this pull request Aug 21, 2024
* Next.js and other config

* Add git-info

* Static build

* V2 Layout and basic page setup (#740)

* Layout mostly done

* Cleanup

* Updated next.config.js

* Delete extra folders

* Remove trailingSlash config

* Add console.log for testing

* V2 Basic demo setup for state management (#741)

* Layout mostly done

* Cleanup

* Updated next.config.js

* Delete extra folders

* Remove trailingSlash config

* Add console.log for testing

* Basic demo setup for state management

* V2 Network selector (#742)

* Network selector functional

* Improved network dropdown functionality

* Network selector done

* Updated network links

* Test PR to trigger PR preview for testing (#743)

### What

Test PR to trigger PR preview for testing

### Why

I need a way to test PR previews for laboratory-v2

### Issue addressed by this PR

stellar/ops#2846

* V2 Intro page + some page placeholders (#744)

* V2 Maintenance banner (#745)

* V2 Add Playwright testing framework with initial tests (#748)

* Updated dependencies

* Playwright config + initial tests

* Disable missingSuspenseWithCSRBailout

* Replace class selector with testId

* V2 Explore Endpoints: Horizon navigation and routes (#764)

* V2 Explore Endpoints: routes + side navigation

* Explore Endpoints landing page

* Privacy Policy and Terms of Service links (#770)

* Privacy Policy and Terms of Service links

* Update font size

* [wip] create account

* [Account Routes] add routes for Account

* updating styles

* rename Account 'routes'

* fix routes

* updating scss to use 'gap'

* fix

* remove unused styling

* Network switch update (#778)

* Update network order

* Fix test

* Upgrade SDS

* Add warning for futurenet

* Explore Endpoints: Basic tabs view setup (#772)

* Explore Endpoints: Params tab view

* Picker components (#777)

* RadioPicker

* OrderPicker

* IncludeFailedPicker

* AssetPicker + PubKeyPicker

* Update hover color + expand transition speed

* Cleanup

* Tweaks and cleanup

* Cleanup

* add <GenerateKeypair/> component (#779)

* Run `eslint:recommended` when committing (#787)

* Creat and Fund Account Page (#788)

* Explore Endpoints: Accounts Params view + template rendering setup (#789)

* Explore Endpoints: data flow functional

* Accounts endpoint done

* Cleanup

* Remove none option + update anim transition

* Clean up input onChange methods

* Require code and issuer for non-native assets

* Text updates

* Fix tests

* use @stellar/stellar-sdk (#795)

* Explore Endpoints submit and response (#797)

* Explore Endpoints: submit + json response

* Cleanup

* Fix reset query on change and submit + PrettyJson unique keys

* Box component + tweak ExpandBox (#800)

* Use Node v20 + updated dependencies (#803)

* Minor dep updates

* Use Node v20

* [Account] create and parse muxed account (#794)

* Explore Endpoints: pages part 1 (#805)

* All Assets

* Claimable Balances

* Effects + refactor endpoint URL template

* Fee Stats

* Ledgers

* Offers

* Operations

* Fix positiveInt validation when changing routes

* update husky's lintstagedrc and linting rule (#804)

* Explore Endpoints: pages part 2 (#807)

* All Assets

* Claimable Balances

* Effects + refactor endpoint URL template

* Fee Stats

* Ledgers

* Offers

* Operations

* Payments

* Transactions

* Update SDS

* Order book + asset object params

* Trade aggregations

* Fix PrettyJson records rendering

* Trades

* Cleanup

* Cleanup

* Fix linting

* Explore Endpoints: pages part 3 (#809)

* All Assets

* Claimable Balances

* Effects + refactor endpoint URL template

* Fee Stats

* Ledgers

* Offers

* Operations

* Payments

* Transactions

* Update SDS

* Order book + asset object params

* Trade aggregations

* Fix PrettyJson records rendering

* Trades

* Cleanup

* Paths

* Liquidity pools

* Fix URL validation

* Cleanup

* Update reserves asset type

* Cleanup

* Don't hard-code component IDs

* Endpoints tests (#811)

* All Assets

* Claimable Balances

* Effects + refactor endpoint URL template

* Fee Stats

* Ledgers

* Offers

* Operations

* Payments

* Transactions

* Update SDS

* Order book + asset object params

* Trade aggregations

* Fix PrettyJson records rendering

* Trades

* Cleanup

* Paths

* Liquidity pools

* Fix URL validation

* Cleanup

* Update reserves asset type

* Cleanup

* Endpoints tests

* Update asset validation

* openUrl helper

* Renamed Explore Endpoints to Endpoints (#813)

* Renamed Explore Endpoints to Endpoints

* Rename View XDR to XDR

* adding tests for create and fund account (#808)

* [Build Transaction] Attributes view UI only (without input values and validation) (#825)

* Build transaction: basic tabs setup

* Attributes UI done

* Update button label

* Rename Attributes to Params

* [Sign TX] Input Overview View (#826)

* PrettyJson theme + updated network accent colors (#830)

* Update network accent colors

* PrettyJson theme updated

* [Create Account] Fund account with Friend button behavior (#827)

* [Build Transaction] Params input and validation + encode JSON to XDR (#832)

* Transaction: build params validation + XDR

* Add temp Stellar XDR package locally

* Moved temp into src

* Fix build

* XDR works

* Cleanup

* Rename GH Action + remove BigNumber.js

* Rename GH action job to build

* [Build Transaction] Basic Operations layout + button actions (#836)

* Clear params btn + extended Box component

* Basic operations layout + buttons with action

* [Build Transaction] Operations setup + create account op (#840)

* [Build Transaction] Added operations  (#843)

* Operation type description + docs URL

* Payment operation

* Manage buy and sell operations

* Create Passive Sell Offer operation

* Update maintenance banner (#846)

* [Build Transaction] Add more operations (#844)

* Operation type description + docs URL

* Payment operation

* Manage buy and sell operations

* Create Passive Sell Offer operation

* Account Merge operation

* Manage Data operation

* Bump Sequence operation

* Claim Claimable Balance operation

* Begin and End Sponsoring Future Reserves operations

* [sign tx] add signing with secrets and ValidationResponseCard (#839)

* [Build Transaction] More operations pt. 4 (#847)

* Operation type description + docs URL

* Payment operation

* Manage buy and sell operations

* Create Passive Sell Offer operation

* Account Merge operation

* Manage Data operation

* Bump Sequence operation

* Claim Claimable Balance operation

* Begin and End Sponsoring Future Reserves operations

* Clawback operation

* Clawback Claimable Balance operation

* Path Payment Strict Send operation

* Path Payment Strict Receive operation

* [Sign Transaction] Enable persisting data on page refresh  (#850)

* [Build Transaction] Set Options operation (#851)

* Operation type description + docs URL

* Payment operation

* Manage buy and sell operations

* Create Passive Sell Offer operation

* Account Merge operation

* Manage Data operation

* Bump Sequence operation

* Claim Claimable Balance operation

* Begin and End Sponsoring Future Reserves operations

* Clawback operation

* Clawback Claimable Balance operation

* Path Payment Strict Send operation

* Path Payment Strict Receive operation

* Set Options operation

* Fix signer key encoding

* [Sign Tx] Integrate with 'stellar-wallets-kit' (#852)

* Update GitHub Action packages (#854)

* [Build Transaction] Change Trust operation (#853)

* Change Trust operation

* Use string value

* [Build Transaction] Allow Trust operation (#856)

* Allow Trust operation

* Cleanup

* Use @stellar/stellar-xdr-json-web package and remove temp files (#863)

* [Sign Tx] Add a sign with hardware wallets (trezor, ledger) (#859)

* [Build Transaction] Liquidity Pool Deposit and Withdraw (#857)

* Change Trust operation

* Allow Trust operation

* Cleanup

* Liquidity Pool Deposit and Withdraw

* [Build Transaction] Set Trust Line Flags + Revoke Sponsorship operations (#858)

* Set Trust Line Flags operation

* Revoke Sponsorship operation

* [Build Transaction] Create Claimable Balance operation (#861)

* Create Claimable Balance operation

* Cleanup

* Cleanup

* [UI] Display commit hash + 404 page design (#865)

* Display commit hash

* 404 page design

* Save commit hash in env var instead of file

* Use .env.local

* Update scripts

* Another test

* Another experiment

* Tweak Docker config

* Cleanup

* [View XDR] UI + decoded JSON (#876)

* Link "Sign in Transaction Signer" button to "Sign Transaction" page (#875)

* Update XDR validation + show error message on View XDR page (#877)

* Update XDR validation + show error message on View XDR page

* Update XDR validation + show error message on View XDR page

* [Submit Tx] Add a Submit Tx Page (#879)

* Updated dependencies + CSP middleware configuration (#884)

* Minor updates

* Configure CSP

* Tweaks

* [View XDR] XDR Type dropdown with search + remove custom key for zustand-querystring (#882)

* XDR type search select

* Use default key in zustand-querystring

* Update test

* Text update + copy JSON button

* Fix clawback claimable balance operation (#887)

* [XDR] JSON To XDR (#886)

* XDR type search select

* Use default key in zustand-querystring

* Update test

* Text update + copy JSON button

* To XDR

* Add Fee Bump Tx (#888)

* [Endpoints] Saved Endpoints (#892)

* Wider content + updated transaction base fee note (#896)

* Make content width wider

* Update txn base fee note text

* Fix assetMulti validation

* [Transactions] Saved Transactions (#895)

* Saved Horizon Endpoints

* XDR: prettify copy JSON

* Fix tests

* Save transactions

* Temp disable tests in pre-push

* Some cleanup

* Enable prefetch for links

* Put back pre-push test

* Update saved endpoints layout

* Update src/app/(sidebar)/transaction/saved/page.tsx

Co-authored-by: jeesun 지선 <[email protected]>

---------

Co-authored-by: jeesun 지선 <[email protected]>

* Maintenance banner: update loading state (#898)

* Maintenance banner: update loading state

* Replace loader

* Temp: test beta website (#902)

* Small tweaks (#901)

* Small tweaks

* Update button variant

* [RPC Endpoints] (#897)

* enable Rpc Url input in network selector

* Fix design issues 737 (#914)

* Update src/components/NetworkSelector/index.tsx

Co-authored-by: Nando Vieira <[email protected]>

* Rename validate methods function (#919)

* [Fund Account] switch network page on mainnet (#917)

* V2: undo beta test (#905)

* ThemeSwitch: fix state on page load (#931)

* [Navigation] Utilize vertical space and add subnavigation for endpoints (#930)

* enable switch button when rpc url is different on mainnet (#920)

* UI tweaks (#932)

* Action button tooltip

* Remove main nav link underline

* Upgrade SDS

* Use custom icon + CSS cleanup

* [Rpc endpoint] Bug fixes (#911)

* Simulate Transaction page (#934)

* Network: persist mainnet RPC URL

* XDR: fix large number parsing in JSON (#953)

* XDR: update labels (#954)

* UI tweaks (#945)

* Updated readme

* Added GitHub links

* Update main nav link order + allow Wallet Kit img source in CSP

* Don't show nothing scheduled maintenance banner

* Adjust Network selector max-width

* Rename nav items + endpoints expand by default

* MultiPicker: delete function + button variant update

* Fix test

* Update link + rename Stellar RPC

* Fix test

* Fix another test

* Submit Transaction using RPC (#941)

* Submit Transaction using RPC

* Reset response on input change

* Add diagnosticEvents output

* Remove unused file

* Submit Transaction: Simulate and Save transaction buttons (#943)

* Submit Transaction using RPC

* Reset response on input change

* Add diagnosticEvents output

* Submit Transaction: Simulate transaction button

* Update Payments for Transaction info link

* delayedAction helper + XDR type const + Sign Tx View XDR button

* Sign tx Fee Bump button

* Updated saved transaction logic + save tx on Submit Transaction page

* Resolved merge conflicts

* Update SEO + rename laboratory to lab (#955)

* Resolve conflicts with master branch (#960)

* correct a link on the endpoint explorer to Horizon API documentation

* Improve Soroban XDR rendering (#746)

* Upgrade to TypeScript v5 (#760)

* XDR: fix contract ID and type rendering (#761)

* XDR: fix scvVec rendering (#763)

* display the correct soroban network (#796)

* Add option to sign transaction hash with Ledger device (#838)

* Upgrade @stellar/stellar-sdk to v12.0.0-rc.1 (#841)

* Upgrade stellar/stellar-sdk to v12.0.0-rc.1

* Use Node v18 in GH action

* Dependency updates (#878)

* Temp: beta test v1 (#903)

* V1: undo beta test (#904)

* Remove CLA reference from contributing document (#958)

* Remove CLA reference from contributing document

* Update CONTRIBUTING.md

---------

Co-authored-by: Elliot Voris <[email protected]>
Co-authored-by: jeesun 지선 <[email protected]>
Co-authored-by: Leigh McCulloch <[email protected]>

* Endpoints: handle JSON response links (#956)

* Endpoints: JSON response account + XDR custom links

* JSON response links

* Do not reset Endpoints for XDR links

* No need to clear errors

* Use href instead onClick

* Use href instead onClick

* Trigger PR preview

* Cleanup test

* Final tweaks (#962)

* correct a link on the endpoint explorer to Horizon API documentation

* Improve Soroban XDR rendering (#746)

* Upgrade to TypeScript v5 (#760)

* XDR: fix contract ID and type rendering (#761)

* XDR: fix scvVec rendering (#763)

* display the correct soroban network (#796)

* Add option to sign transaction hash with Ledger device (#838)

* Upgrade @stellar/stellar-sdk to v12.0.0-rc.1 (#841)

* Upgrade stellar/stellar-sdk to v12.0.0-rc.1

* Use Node v18 in GH action

* Dependency updates (#878)

* Temp: beta test v1 (#903)

* V1: undo beta test (#904)

* Remove CLA reference from contributing document (#958)

* Remove CLA reference from contributing document

* Update CONTRIBUTING.md

* Final tweaks

---------

Co-authored-by: Elliot Voris <[email protected]>
Co-authored-by: jeesun 지선 <[email protected]>
Co-authored-by: Leigh McCulloch <[email protected]>

---------

Co-authored-by: jacekn <[email protected]>
Co-authored-by: Jeesun Kim <[email protected]>
Co-authored-by: Jeesun Kim <[email protected]>
Co-authored-by: jeesun 지선 <[email protected]>
Co-authored-by: Nando Vieira <[email protected]>
Co-authored-by: Jane Wang <[email protected]>
Co-authored-by: Elliot Voris <[email protected]>
Co-authored-by: Leigh McCulloch <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants