Commit Graph

177 Commits

Author SHA1 Message Date
sakridge
068d23f298 Add Binary64 option for account data (#11474)
* Add Binary64 option for account data

* Decode into binary64

* Reword docs
2020-08-08 22:40:13 -07:00
Tyera Eulberg
b7c2681903 Token Accounts: return ui_amount, decimals with decoded account (#11407)
* Return ui_amount, decimals from token client methods

* Return ui_amount, decimals in RPC jsonParsed token accounts

* Fixup docs

* Return ui_amount, decimals in pubsub jsonParsed token accounts

* Remove unnecessary duplicate struct

* StringAmount rename
2020-08-07 11:37:39 -06:00
Michael Vines
02c0981ecf Rename startAfter to before 2020-08-05 14:33:14 -07:00
Michael Vines
1b2276520b Add getConfirmedSignaturesForAddress2 RPC method 2020-08-05 14:33:14 -07:00
Tyera Eulberg
86e3f96f16 Return token amounts as floats (#11370)
* Return token amounts as floats

* Floating-point equality

* Return float and raw token amounts

* Fix decimals and token rpcs for native-mint tokens

* Fixup docs and review comments
2020-08-05 06:48:09 +00:00
Michael Vines
b5e03d6df2 get_token_accounts_by_owner now returns UiTokenAccounts 2020-08-04 22:45:00 +00:00
Tyera Eulberg
d0144ce382 Fix token rpc-client methods (#11361)
* Convert None to error in parse_keyed_accounts

* Allow encoding configuration in getTokenAccounts methods
2020-08-04 11:11:30 -06:00
Tyera Eulberg
9bcfc51df1 Add token rpc endpoints to rpc-client (#11315) 2020-07-31 20:53:49 +00:00
Trent Nelson
bece8cfbc2 Add RpcClient constructor with timeout 2020-07-23 22:29:40 +00:00
Tyera Eulberg
2669ccb864 Update struct prefixes to Ui (#10874)
* Update comments

* Use Ui prefix
2020-07-01 20:06:40 +00:00
Tyera Eulberg
d97850f1d9 Add account-decoder utilities (#10846)
* Fix comment and make less pub

* Add account-decoder crate and use to decode vote and system (nonce) accounts

* Update docs

* Rename RpcAccount struct

* s/Rpc/Display

* Call it jsonParsed and update docs

* Revert "s/Rpc/Display"

This reverts commit 6e7149f503.

* s/Rpc/Ui

* Add tests

* Ui more things

* Comments
2020-07-01 04:55:11 +00:00
Tyera Eulberg
7a741bb79a Move commitment to CliConfig to enable faster integration tests (#10627)
* Add commitment config to CliConfig

* Use config.commitment in cluster_query

* Use config.commitment in vote

* Add method with spinner + commitment

* Add send-transaction config to CliConfig

* Remove superfluous nonce check

* Add with_commitment helper fns

* Update src to use commitment

* Fix pay and transfer integration tests

* Fix nonce int tests

* Fix deploy int test

* Fix vote int test

* Fix stake int tests

* Nightly clippy

* Review comments
2020-06-17 12:18:48 -06:00
Kristofer Peterson
e23340d89e Clippy cleanup for all targets and nighly rust (also support 1.44.0) (#10445)
* address warnings from 'rustup run beta cargo clippy --workspace'

minor refactoring in:
- cli/src/cli.rs
- cli/src/offline/blockhash_query.rs
- logger/src/lib.rs
- runtime/src/accounts_db.rs

expect some performance improvement AccountsDB::clean_accounts()

* address warnings from 'rustup run beta cargo clippy --workspace --tests'

* address warnings from 'rustup run nightly cargo clippy --workspace --all-targets'

* rustfmt

* fix warning stragglers

* properly fix clippy warnings test_vote_subscribe()
replace ref-to-arc with ref parameters where arc not cloned

* Remove lock around JsonRpcRequestProcessor (#10417)

automerge

* make ancestors parameter optional to avoid forcing construction of empty hash maps

Co-authored-by: Greg Fitzgerald <greg@solana.com>
2020-06-09 09:38:14 +09:00
Michael Vines
7e2651ca51 RPC simulateTransaction endpoint now returns program log output (#10432) 2020-06-06 10:18:28 -07:00
Michael Vines
6498cb4214 Remove some unused RpcClient and ThinClient methods 2020-06-02 07:44:30 -07:00
Michael Vines
df216b0e98 Remove RpcClient::resign_transaction() 2020-06-02 07:44:30 -07:00
Michael Vines
202512d46b Adapt solana deploy 2020-06-01 17:51:04 -07:00
Michael Vines
f1733ab125 Add send_transaction_with_config 2020-06-01 17:51:04 -07:00
Tyera Eulberg
b563b49ed5 Improve Rpc inflation tooling (#10309)
automerge
2020-05-29 11:50:25 -07:00
Tyera Eulberg
3f0995d3b4 Add commitment parameter to getFeeCalculatorForBlockhash (#10255)
* Accept commitment parameter on getFeeCalculatorForBlockhash

* Update docs

* Add get_fee_calculator_for_blockhash_with_commitment to rpc client
2020-05-26 17:23:58 -06:00
Tyera Eulberg
4e431bc818 Add mechanism to get blockhash's last valid slot (#10239)
automerge
2020-05-26 12:06:21 -07:00
Michael Vines
4779858dd4 Clean up RPCClient retry handling: only retry on 429, after a little sleep (#10182) 2020-05-22 08:53:53 -07:00
Greg Fitzgerald
64cec764b9 Allow RpcClient users to inject custom "senders" (#10157)
automerge
2020-05-20 18:40:45 -07:00
sakridge
ce17de7d25 Add option to wait for a specific epoch length to bench-tps (#10083) 2020-05-20 16:42:46 -07:00
Michael Vines
427c78d891 Add SimulateTransaction RPC endpoint (#10106)
automerge
2020-05-19 12:08:19 -07:00
Kristofer Peterson
58ef02f02b 9951 clippy errors in the test suite (#10030)
automerge
2020-05-15 09:35:43 -07:00
Tyera Eulberg
ed53a70b5c Cli: transfer ALL; check spend+fee in client (#10012)
* lamports->SOL in user-facing error msg

* Check for sufficient balance for spend and fee

* Add ALL option to solana transfer

* Rework TransferAmount to check for sign_only in parse

* Refactor TransferAmount & fee-check handling to be more general

* Add addl checks mechanism

* Move checks out of cli.rs

* Rename to SpendAmount to be more general & move

* Impl ALL/spend helpers for create-nonce-account

* Impl spend helpers for create-vote-account

* Impl ALL/spend helpers for create-stake-account

* Impl spend helpers for ping

* Impl ALL/spend helpers for pay

* Impl spend helpers for validator-info

* Remove unused fns

* Remove retry_get_balance

* Add a couple unit tests

* Rework send_util fn signatures
2020-05-14 12:24:14 -06:00
Tyera Eulberg
ee7f15eff1 Rpc: optionally filter getLargestAccounts by circulating/nonCirculating (#10007)
* Add circ/non-circ filter to getLargestAccounts

* Plumb largest accounts into client and cli

* Bump timeout toward CI flakiness

* Update docs
2020-05-12 21:05:05 -06:00
Michael Vines
19722fceb3 Fixup supply_with_commitment 2020-05-10 11:50:15 -07:00
Tyera Eulberg
dd78184f8f Cli: Add solana supply command; hide total-supply (#9956)
* Add cli supply command; hide total-supply

* Use print-accounts arg instead of verbose
2020-05-10 12:05:14 -06:00
Michael Vines
af6a8f5fac Remove RpcClient code duplication (#9952) 2020-05-10 08:51:53 -07:00
Michael Vines
cb50877bbf send_and_confirm_transaction() no longer needs a keypair (#9950) 2020-05-09 09:06:32 -07:00
Jack May
a8394317c7 Wait for at least one confirmation when uploading program data (#9850)
automerge
2020-05-02 20:11:50 -07:00
Tyera Eulberg
2f08b12753 Rpc Client: Prevent error out on get_num_blocks_since_signature_confirmation (#9792)
automerge
2020-04-29 13:12:38 -07:00
Michael Vines
914b022663 cli: Add transaction-history (#9614)
automerge
2020-04-20 22:01:09 -07:00
Michael Vines
7e7cbec8a1 Passing -v/--verbose to solana confirm now displays the full transaction 2020-04-16 08:19:30 -07:00
Tyera Eulberg
68b099c277 Print signature as part of progress spinner (#9484)
automerge
2020-04-13 22:04:20 -07:00
Tyera Eulberg
6b988155e1 RpcClient: include signature check in send_transaction, bump send retries in get_num_blocks_since_signature_confirmation (#9341)
* Bump rpc send retries

* Add signature check to send_transaction and update mocks to test
2020-04-06 19:27:37 -06:00
Tyera Eulberg
acf64f8476 Update getSignatureStatuses to return historical statuses (#9314)
automerge
2020-04-06 03:04:54 -07:00
Justin Starry
b584174d67 Deprecate confirmTransaction, getSignatureStatus, and getSignatureConfirmation (#9298)
* Deprecate `confirmTransaction`, `getSignatureStatus`, etc

* Rename get_signature_statuses to get_signature_statuses_with_commitment

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-04-05 14:31:24 +08:00
Justin Starry
c7ba1994ac Undo getSignatureStatus breaking change, add getSignatureStatuses (#9228)
automerge
2020-04-01 11:30:58 -07:00
Tyera Eulberg
56667e17c9 Fix panic (#9195)
automerge
2020-03-31 18:33:46 -07:00
Michael Vines
4a8b1d9b2c RpcClient now returns Signatures instead of Strings (#9129) 2020-03-27 15:46:00 -07:00
Tyera Eulberg
4b97e58cba Consolidate signature-status rpcs (#9069)
* getSignatureStatus: return confirmations for non-rooted transactions

* Remove getNumConfirmations.. rpc

* Remove getSignatureConfirmation

* Review comments

* More review comments
2020-03-26 19:21:01 -06:00
sakridge
b7b4aa5d4d move rpc types from client to client-types crate (#9039)
* Separate client types into own crate, so ledger does not need it

Removes about 50 crates of dependency from ledger

* Drop Rpc name from transaction-status types
2020-03-26 13:29:30 -07:00
Michael Vines
56dc958116 Add get_confirmed_block_with_encoding() (#9046)
automerge
2020-03-24 05:05:38 -07:00
Tyera Eulberg
1b8f9e75dd Update getSignatureStatus: support multiple signatures, include slot in each response item (#9022)
* Rename enable-rpc-get-confirmed-block

* Rename RpcTransactionStatus -> RpcTransactionStatusMeta

* Return simplified RpcTransactionStatus; Add support for multiple transactions

* Update docs

* typo
2020-03-23 11:25:39 -06:00
Tyera Eulberg
b84468ecd3 Cli: polish transaction progress bar (#8963)
automerge
2020-03-19 11:10:35 -07:00
Tyera Eulberg
f0414711b7 Cli: add spinner progress bar when waiting for transaction confirmation (#8916)
* Add _with_spinner method

* Use _with_spinner method in cli
2020-03-17 17:58:02 -06:00
Trent Nelson
fbf2dd1672 CLI: Error message cleanup (#8804)
automerge
2020-03-12 23:20:49 -07:00