Commit Graph

390 Commits

Author SHA1 Message Date
Greg Fitzgerald 55115d0eeb Add process_message() to BankClient 2019-03-27 08:51:10 -06:00
Greg Fitzgerald 8c69c40834 Make space for a new Transaction::new 2019-03-26 20:06:05 -06:00
Rob Walker d497b99abb
use solana_entrypoint directly (#3518) 2019-03-26 16:40:34 -07:00
Greg Fitzgerald b61aed7250 Minor cleanup 2019-03-25 20:31:13 -07:00
Greg Fitzgerald 4bc3f70150 Boot VoteTransaction 2019-03-25 17:11:57 -07:00
Greg Fitzgerald caff603497 Less code 2019-03-24 21:44:04 -07:00
Greg Fitzgerald aefa9891c0 Delete unused code 2019-03-24 21:44:04 -07:00
Greg Fitzgerald 6286947697 Inline payment_plan
This module predates Accounts. That was a separate module because
it used to be part of Bank and those types could be sent to any
smart contract. Now each instruction processor defines for itself
what instructions it accepts.
2019-03-24 14:52:06 -06:00
Greg Fitzgerald 33972ef89e Boot BudgetTransaction 2019-03-24 14:52:06 -06:00
Greg Fitzgerald b53cbdd9e6 Punt on the Script abstraction
Low ROI
2019-03-24 14:52:06 -06:00
Greg Fitzgerald c49e84c75b Boot StorageTransaction 2019-03-24 13:51:02 -07:00
Greg Fitzgerald dcf2337e58 Add StorageInstruction constructors 2019-03-24 13:51:02 -07:00
Greg Fitzgerald 5a65c3f72e Test-drive StorageContract 2019-03-24 13:51:02 -07:00
Greg Fitzgerald 8ff1987d2d Reorg Storage program to look more like the others 2019-03-24 13:51:02 -07:00
Greg Fitzgerald acedf4ca5a Move Instruction into its own module 2019-03-23 20:31:55 -07:00
Jack May 6505221629
Add exchange program (#3444) 2019-03-22 21:07:36 -07:00
Greg Fitzgerald 5f41909098 Stop using VoteTransaction in Vote processor 2019-03-22 14:07:00 -06:00
Greg Fitzgerald 38fdbbba3f Reduce remaining program crates to boilerplate crates 2019-03-22 06:46:44 -07:00
Greg Fitzgerald 045af04784 Reduce budget_program and config_program into boilerplate crates 2019-03-21 16:53:08 -06:00
Greg Fitzgerald d0761f57e8 Add _program suffix to directories of crates with _program suffix 2019-03-21 16:24:06 -06:00
Greg Fitzgerald 4bb88619fd Move entrypoint boilerplate into a macro 2019-03-21 15:27:49 -06:00
Greg Fitzgerald 2b00a42b06 Boot Rewards program 2019-03-21 12:07:20 -06:00
Greg Fitzgerald d2415613de Migrate loader tests to BankClient 2019-03-21 09:19:24 -06:00
Greg Fitzgerald 94b5835738 Make AccountMeta a traditional struct instead of a tuple struct 2019-03-19 17:22:39 -06:00
Greg Fitzgerald a4652a9aaf Label tuple with AccountMeta 2019-03-19 17:22:39 -06:00
Michael Vines d0292b1cf1 store transaction no longer takes the transaction fee from the config account 2019-03-18 18:34:08 -07:00
anatoly yakovenko 61a4b998fa
Implement locktower voting (#3251)
* locktower components and tests

* integrate locktower into replay stage

* track locktower duration

* make sure threshold is checked after simulating the vote

* check vote lockouts using the VoteState program

* duplicate vote test

* epoch stakes

* disable impossible to verify tests
2019-03-18 12:12:33 -07:00
Greg Fitzgerald 8d032aba9d Merge InstructionError and ProgramError
From the user's perspective, it's just an instruction error.
For program-specific errors, we still have
InstructionError::CustomError.
2019-03-18 10:39:20 -06:00
Greg Fitzgerald 607b368fe3 Add back in test to check the account program id 2019-03-18 08:22:54 -07:00
Greg Fitzgerald a54854abc7 Do Budget verification in BudgetScript 2019-03-18 08:22:54 -07:00
Greg Fitzgerald ce6257a069 Delete misplaced unit-tests
These tests were from back in the day when Bank(then-called Accountant)
would call `verify_plan()` on all transactions. Nowadays `verify_plan`
is only useful to the client. At can be used to ensure a transaction
won't trigger runtime errors.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald 7b28d3a231 Move Budget's verify_plan() into tests
This functionality is supposed to be the the interpreter
2019-03-18 08:22:54 -07:00
Greg Fitzgerald ea01ff2aab Add pubkey to BudgetExpr::new_cancelable_future_payment for wallet 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 3369019943 Add BudgetExpr::new_cancelable_authorized_payment 2019-03-18 08:22:54 -07:00
Greg Fitzgerald dbd4176b97 Move script constructors into a separate module 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 122c7bc2ef Rename TransactionCompiler to Script and use it to replace the type alias 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 99671472d1 Migrate config tests to Bank 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 0c0716abfb Move Bank-based tests into unit-tests 2019-03-18 08:22:54 -07:00
Greg Fitzgerald c09accb685 Rename StaticEntrypoint to ProcessInstruction 2019-03-18 08:22:54 -07:00
Greg Fitzgerald ae4d14a2ad Introducing Scripts
A sequence of instructions. A client compiles the script and then uses
the compiled script to construction a transaction. Then it adds a
adds a blockhash, signs the transaction, and sends it off for
processing.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald 55cdbedb52 Allow tests to add instruction processors
Make runtime a private module again.
2019-03-18 08:22:54 -07:00
Greg Fitzgerald ee39f31d81 Add Runtime object. Allow any number of static loaders. 2019-03-18 08:22:54 -07:00
Greg Fitzgerald 70b45de012 Get access to runtime errors in Budget unit-tests 2019-03-18 08:22:54 -07:00
Michael Vines 5f58e9cd6e Config program - useful for storing/updating simple config items on chain 2019-03-15 16:39:45 -07:00
Greg Fitzgerald 24d9138067 Abandon Builder pattern 2019-03-15 14:46:44 -06:00
Greg Fitzgerald aca739b800 Boot fees from TransactionBuilder 2019-03-15 14:46:44 -06:00
Greg Fitzgerald e091aa87ea More precise constructor names 2019-03-15 14:46:44 -06:00
Greg Fitzgerald 968022a1b0 Instruction name swap
* Instruction -> GenericInstruction
* Instruction<u8, u8> -> CompiledInstruction
* Instruction<Pubkey, (Pubkey, bool)> -> Instruction
2019-03-15 14:46:44 -06:00
Greg Fitzgerald 8306c1841c Fix build 2019-03-15 09:06:54 -06:00
Greg Fitzgerald 4d53be8350 Make it unappealing to build and sign transactions at the same time
Use a client to sign transactions. It'll need that keypair anyway
to resign new blockhashes on retries.
2019-03-15 09:06:54 -06:00
Greg Fitzgerald c1eec0290e
Rename userdata to data (#3282)
* Rename userdata to data

Instead of saying "userdata", which is ambiguous and imprecise,
say "instruction data" or "account data".

Also, add `ProgramError::InvalidInstructionData`

Fixes #2761
2019-03-14 10:48:27 -06:00
Greg Fitzgerald e58220282a Move TransactionError into the SDK 2019-03-13 21:26:57 -06:00
Greg Fitzgerald 4ca4038d54 Rename BankError to TransactionError 2019-03-13 21:26:57 -06:00
Greg Fitzgerald c14cce4c85 Add InstructionError for runtime instruction errors 2019-03-13 21:26:57 -06:00
Sagar Dhawan c1e726da87 Remove comment 2019-03-12 15:32:41 -07:00
Sagar Dhawan 7d7528eb18 Fix test_bank_storage 2019-03-12 15:32:41 -07:00
Michael Vines 1ee43a7633 Remove non-essential programs from runtime/ 2019-03-12 15:11:59 -05:00
Michael Vines 3d2b7dd1ef Move programs/system into runtime/ 2019-03-12 11:30:58 -05:00
Michael Vines 6899bd7099
0.13.0 2019-03-11 16:21:19 -07:00
Tyera Eulberg fe1676bc3a Review comments 2019-03-11 16:58:43 -06:00
Tyera Eulberg 1a9ef37251 Update programs using simple error mapping to use CustomError 2019-03-11 16:58:43 -06:00
Rob Walker 195a880576
pass Pubkeys as refs, copy only where values needed (#3213)
* pass Pubkeys as refs, copy only where values needed

* Pubkey is pervasive

* fixup
2019-03-09 19:28:43 -08:00
Rob Walker 0acdbc0d03 plumb staking_account and voting_keypair from multinode-demo to Vote (#3199)
* plumb staking_account and voting_keypair from bash to Vote
2019-03-08 19:29:08 -07:00
Greg Fitzgerald 7a4ccc8719 Fix Budget's payment_with_fee test
Fee is now independent of the contract.
2019-03-07 19:18:53 -07:00
Greg Fitzgerald 3dc22e7323 Simulate auto-creation of system accounts 2019-03-07 19:18:53 -07:00
Greg Fitzgerald 17dcd1f62a Resurrect the tests 2019-03-07 19:18:53 -07:00
Greg Fitzgerald a277f3e816 Migrate to TransactionBuilder
This code wasn't updated after we started batching instructions.
The current code does allocations instead of using CreateAccount.
The runtime shouldn't allow that, so getting this code out of the
way before we lock down the runtime.
2019-03-07 19:18:53 -07:00
Greg Fitzgerald 10b16753af Remove 'new' constructor 2019-03-07 19:18:53 -07:00
Greg Fitzgerald 4d58bf4b28 Don't use solana_entrypoint in static libraries 2019-03-07 12:42:13 -07:00
Greg Fitzgerald 505f77b108 Move a more generic process_transaction to runtime.rs 2019-03-07 12:42:13 -07:00
Greg Fitzgerald 5b672f8921 Generalize Budget tests to work on multi-ix txs 2019-03-07 12:42:13 -07:00
Greg Fitzgerald 97f2c96a7e Add a transaction and instruction 2019-03-06 15:04:15 -07:00
Greg Fitzgerald 5979627258 Add authorized voter 2019-03-06 15:04:15 -07:00
Michael Vines 9491999a95 Remove remaining erc20 references 2019-03-05 17:56:44 -08:00
Michael Vines e2d30db7e1 Rename tokens to lamports 2019-03-05 17:56:44 -08:00
Michael Vines 3129e299e4 Rename tokens to lamports in programs/ 2019-03-05 17:56:44 -08:00
Michael Vines 53f09c44f3 Rename tokens to lamports in sdk/ 2019-03-05 17:28:06 -08:00
Greg Fitzgerald ca99ebaaf4 Add way to create account with delegate in 1 tx 2019-03-05 16:14:57 -07:00
Rob Walker b9e878ee80
slot_height considered harmful (#3135)
* slot_height considered harmful
* fix test_tick_slot_epoch_indexes
2019-03-05 14:18:29 -08:00
Tyera Eulberg 33c4c7e511 Split up long test 2019-03-05 15:16:51 -07:00
Tyera Eulberg b67ac22336 Replace superfluous integration tests with needed one 2019-03-05 15:16:51 -07:00
Tyera Eulberg 6ff2572ebe Refactor system entrypoint to use helper fns; add unit tests 2019-03-05 15:16:51 -07:00
Greg Fitzgerald 52fc974cdf The funder is not a staker 2019-03-05 12:46:18 -07:00
Tyera Eulberg f506b0a224 Fix test: Prevent SystemInstruction CreateAccount from overwriting accounts in use 2019-03-05 09:33:27 -07:00
Tyera Eulberg 202adb1bf1 Create failing test 2019-03-05 09:33:27 -07:00
Greg Fitzgerald 885eeec3ed Boot storage program from the SDK 2019-03-05 07:16:33 -07:00
Greg Fitzgerald 5e9f802d7d Boot token_program from the SDK 2019-03-05 07:16:33 -07:00
dependabot[bot] e4be57c3b6 Bump libc from 0.2.49 to 0.2.50
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.49 to 0.2.50.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.49...0.2.50)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-03-05 07:14:51 -07:00
Sagar Dhawan dc42c12f2b
Revert to more consistent naming (#3114) 2019-03-04 17:50:19 -08:00
Michael Vines 03d6c9a552 Defeature bpf_loader; bpf_{c,rust} features now confined to programs/bpf 2019-03-04 11:02:37 -08:00
Michael Vines d0be16b49a Remove duplicated code 2019-03-04 11:02:37 -08:00
Greg Fitzgerald 2ec9bc9f05 Revive payments via Budget 2019-03-03 17:29:13 -07:00
Greg Fitzgerald e8ae603a01 Add failing test for a Budget payment 2019-03-03 17:29:13 -07:00
Greg Fitzgerald 8ec10d4de9 Simplify Budget's serialize 2019-03-03 14:24:53 -08:00
Greg Fitzgerald baca3e6b6b Cleanup Budget
* BudgetProgram -> BudgetState
* Instruction -> BudgetInstruction
* Move BudgetState into its own module
* BudgetInstruction::NewBudget -> BudgetInstruction::InitializeAccount
* BudgetInstruction::new_budget -> BudgetInstruction::new_initialize_account
2019-03-03 14:49:35 -07:00
Greg Fitzgerald fc5fcd6cd4 Move native_loader into solana_runtime 2019-03-03 10:59:08 -07:00
Michael Vines 33496ffea2 Adjust paths 2019-03-02 22:11:48 -08:00
Michael Vines b8b7de5522 Script can now be run from any directory 2019-03-02 22:11:48 -08:00
Michael Vines 109101c2dc Cleanup features and fix build errors 2019-03-02 22:11:48 -08:00
Greg Fitzgerald 44322124c8 Update paths 2019-03-02 22:11:48 -08:00