385 Commits

Author SHA1 Message Date
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