Commit Graph

234 Commits

Author SHA1 Message Date
Ross Nicoll
93e9d0459c Add custom serialiser for NonEmptySet 2016-06-20 16:08:17 +01:00
Ross Nicoll
723e610dfc Rename verifyMoveCommand()
Rename verifyMoveCommands() to verifyMoveCommand() to represent that move commands must
be singular within a transaction.
2016-06-20 16:08:16 +01:00
Ross Nicoll
af53a52b06 Add common Issue and Move commands
* Add common Issue command to encourage presence of a nonce value when issuing state objects.
* Add common Move command for contracts which support being moved in order to fulfil other contracts.
2016-06-20 16:08:16 +01:00
Andras Slemmer
32b593671b Merged in remove-warnings (pull request #169)
Remove warnings
2016-06-20 14:45:04 +01:00
Ross Nicoll
8f57213270 Merged in rnicoll-force-record-tx (pull request #152)
Require all transactions are added via the ServiceHub.recordTransaction() function
2016-06-20 14:25:20 +01:00
Ross Nicoll
a5e07c2600 Require all transactions are added via the ServiceHub.recordTransaction() function 2016-06-20 14:24:55 +01:00
Andras Slemmer
878a683823 core: Remove warnings 2016-06-20 14:16:13 +01:00
Andras Slemmer
c9cb024bb5 Merged in use-urandom-2 (pull request #166)
Use urandom 3
2016-06-20 14:15:03 +01:00
Andras Slemmer
a7419b116d Add newSecureRandom() that uses a non-blocking SecureRandom provider on Linux 2016-06-20 14:11:03 +01:00
Mike Hearn
d4674a9d8f Add a comment to ContractState describing the intended constraints design. 2016-06-20 15:00:16 +02:00
Andrius Dagys
30ca340b6e Refactored NotaryChangeProtocol and tests: moved the proposal verification step into the protocol.
Added another proposal verification step in the NotaryChangeProtocol.
Added the cause exception message to the 'notary change refused' error.
2016-06-17 15:05:35 +01:00
Andrius Dagys
0a5b7ace35 Made TransactionBuilder abstract. Every transaction type now needs to implement and provide its own Builder. This is required since for specific types we need to run different logic when adding new items to the transaction. For example, when adding a new input state to a transaction of type NotaryChange we need to add all of the states participants to the signers list. 2016-06-17 15:05:35 +01:00
Andrius Dagys
9958b5c603 Added 'signers' property to the transaction data models. Signers holds the list of all public keys that need to be signed for (command keys and additional ones such as notary).
Removed Notary & ChangeNotary commands, keys to be signed for are added to the signers list during transaction build phase.
2016-06-17 15:05:35 +01:00
Andrius Dagys
70495a021e Introduce TransactionState, which wraps ContractState and holds the notary pointer.
Remove notary from ContractState.
Introduce TransactionType, which specifies custom validation logic for a transaction.
2016-06-17 15:05:35 +01:00
Andrius Dagys
3b1e020082 Extended the data model so that every state has to define a set of 'participants' - parties that are able to consume that state in a valid transaction.
Added protocol for changing the notary for a state, which requires signatures from all participants
2016-06-17 15:05:35 +01:00
Andras Slemmer
0c325c31a2 Revert "Merged in use-urandom-2 (pull request #159)"
This reverts commit 1a1ed3b9e6, reversing
changes made to 09e2e49d44.
2016-06-17 14:12:19 +01:00
Andras Slemmer
1a1ed3b9e6 Merged in use-urandom-2 (pull request #159)
Use /dev/urandom try no.2
2016-06-17 13:36:23 +01:00
Andras Slemmer
f9d1c54195 core: Add comments explaining the never-to-be-removed deprecated functions 2016-06-17 13:27:35 +01:00
Andras Slemmer
1f171a1ece Revert "core: Removed unused deprecated test functions"
This reverts commit 1c09ff86ed6803fcda6c76b6f5e323621c4b0e06.
2016-06-17 13:27:35 +01:00
Andras Slemmer
eaf37e2e7a core: make comment javadoc style 2016-06-17 13:27:35 +01:00
Andras Slemmer
643d3bab2b core: force transaction tests to check for accept/fail 2016-06-17 13:27:35 +01:00
Andras Slemmer
f0d74d0859 core: Removed unused deprecated test functions 2016-06-17 13:27:35 +01:00
Andras Slemmer
ea7f9177d4 core: make newSecureRandom() a one-liner 2016-06-17 13:07:25 +01:00
Andras Slemmer
481d2f7151 core: use newSecureRandom() instead of SecureRandom.getInstanceStrong() 2016-06-17 13:07:25 +01:00
Andras Slemmer
6229e39b42 core: Add newSecureRandom() that uses a non-blocking SecureRandom provider 2016-06-17 13:07:25 +01:00
Andras Slemmer
f06487aa4c Merged in sort-of-incremental-quasarScan (pull request #154)
Sort of incremental quasarscan
2016-06-17 10:38:39 +01:00
Shams Asari
7f3458803c Protocols can use the serviceHub lazily in their constructors 2016-06-17 10:30:25 +01:00
Andras Slemmer
dc5da8e1ad build: use QuasarPlugin instead of copypasta 2016-06-17 10:16:46 +01:00
Andras Slemmer
2663a6390e core: Kryo extension methods for reading/writing ByteArrays prefixed with their sizes 2016-06-16 17:03:44 +01:00
Andras Slemmer
5b4c4f167d core: .equals() -> == 2016-06-16 17:03:44 +01:00
Andras Slemmer
2b4ebd4f09 core: use optimizedPositive for size serialization 2016-06-16 17:03:44 +01:00
Andras Slemmer
cd91c6a0e7 core: add serialization test for keypairs 2016-06-16 17:03:44 +01:00
Andras Slemmer
af3d87803d core: serialize bytearray sizes instead of relying on static sizes 2016-06-16 17:03:44 +01:00
Andras Slemmer
376b73b823 core: switch to static size bytearray serialization of keypairs 2016-06-16 17:03:44 +01:00
Andras Slemmer
22567d11b5 core: implement custom serializers for ed25519 keypairs 2016-06-16 17:03:44 +01:00
Andras Slemmer
1fe283c113 core: switch to ed25519 2016-06-16 17:03:44 +01:00
Andras Slemmer
9930e8d5c7 core: add net.i2p.crypto:eddsa dependency 2016-06-16 17:03:44 +01:00
Rick Parker
512e304bf1 Merged in remove-commented-out-resolve-tx-proto (pull request #156)
Remove commented out ResolveTransactionsProtocol call as it is not required
2016-06-16 16:19:03 +01:00
Ross Nicoll
ad72f3e48f Add issuer to cash amounts
Add issuer of a cash when referring to amounts of cash (except for the very few cases where
the issuer is not important, such as when referring to aggregated totals across a set of
issuers). Replaces CommonCashState with TokenDefinition, as a more accurate reflection of
what the class represents.
2016-06-16 15:05:49 +01:00
rick.parker
cae39332bf Remove commented out ResolveTransactionsProtocol call as it is not required 2016-06-16 13:15:37 +01:00
Ross Nicoll
f831ffdf3d Add tests for TransactionGraphSearch 2016-06-15 16:21:53 +01:00
Shams Asari
aa153be6f0 moved methods in ChildrenProgressTrackers into ProgressTracker 2016-06-14 16:42:42 +01:00
Richard Green
2ce0dce0aa . 2016-06-14 11:28:58 +01:00
Richard Green
86203709c0 Payment dates now are calculated as an offset to the period end date 2016-06-13 19:00:27 +01:00
rick.parker
73cbab0084 Pull out Wallet observable into it's own branch
Review feedback

Review feedback

Apply feedback from previous PR

Apply feedback from previous PR

Apply feedback from previous PR

PR feedback

PR feedback

PR feedback
2016-06-10 17:16:56 +01:00
Shams Asari
2365f9bca5 Persisting transactions to disk 2016-06-08 10:15:14 +01:00
rick.parker
97e04ba7d0 Fix registration of services due to Kryo not following synthetic fields by default
Review feedback
2016-06-07 16:29:59 +01:00
Andrius Dagys
21f53a7d3e Revert "Revert "Merged in validating-notary (pull request #123)""
This reverts commit e64145991e.
2016-06-07 13:53:00 +01:00
Ross Nicoll
f4f0e160d2 Genericise Cash contract to support non-Currency things
Split the verification and commands for the Cash contract into a new AbstractCashLike
class, and make Cash a concrete implementation of that class, specialised for dealing
with Currency as the underlying token.
2016-06-07 13:49:26 +01:00
Andrius Dagys
e64145991e Revert "Merged in validating-notary (pull request #123)"
This reverts commit d9f4e4da2e, reversing
changes made to 654dc3f60a.
2016-06-07 12:29:27 +01:00
Andrius Dagys
c45bc0df20 Split up Notary protocol into Client and Service parts. The Service protocol can be extended to provide additional transaction processing logic, e.g. validation.
Implemented a Simple and Validating Notary services.
2016-06-07 10:58:34 +01:00
Shams Asari
654dc3f60a Resuming from checkpoints now working - seller (but not buyer) in trader demo can be restarted 2016-06-06 17:49:40 +01:00
rick.parker
8122e35a8a Have ServiceHub entries implement SerializeAsToken so they are not copied into protocol checkpoints. 2016-06-06 16:55:46 +01:00
Ross Nicoll
d7b367965f Genericise Amount class
Make the Amount class generic so it doesn't have to represent a quantity of a
currency, but can handle other things such as assets as well, or extended detail
(for example a currency-issuer tuple).
2016-06-01 11:58:13 +01:00
Ross Nicoll
f7c0756526 Add a dummy test to NonEmptySetTest.Guava
Add a dummy test so that when IntelliJ (incorrectly) scans NonEmptySetTest.Guava
looking for tests, it finds one and doesn't complain.
2016-05-25 10:17:02 +01:00
Ross Nicoll
e3727a1de6 Merged in rnicoll-base58-tests (pull request #113)
Port Base58Test to Kotlin
2016-05-24 18:20:56 +01:00
Rick Parker
570dc38423 Merged in cor-133-clock-helpers (pull request #112)
MutableClock for testing, simulation and demos plus associated utilities
2016-05-24 17:58:37 +01:00
Ross Nicoll
4744740913 Add NonEmptySet
Add a new set-like collection which is constrained to ensure it's never
empty.
2016-05-24 15:39:24 +01:00
Ross Nicoll
40b6b0d186 Port Base58Test to Kotlin 2016-05-24 14:20:53 +01:00
rick.parker
f8e610aa71 Re-apply changes 2016-05-24 09:41:00 +01:00
Matthew Nesbit
63a5fd1b9e Add com.r3corda to all namespaces. 2016-05-23 14:53:56 +01:00
Matthew Nesbit
d1e8d15d9d Merge branch 'mnesbit-cor-174-refactor-namespaces' of https://bitbucket.org/R3-CEV/r3prototyping into mnesbit-cor-174-refactor-namespaces
# Conflicts:
#	core/src/main/kotlin/core/testing/TestUtils.kt
2016-05-20 16:56:41 +01:00
Matthew Nesbit
1d5f409c66 Remove unnecessary .Companion statements brought in during refactoring. 2016-05-20 16:43:03 +01:00
Matthew Nesbit
60ff42dd30 Move test to core as part of tidy up. 2016-05-20 16:43:02 +01:00
Matthew Nesbit
69cba98ddc Push unit tests that needed some contract functionality into core by embedding the minimal contract support needed. 2016-05-20 16:43:02 +01:00
Matthew Nesbit
f6f56797ce Refactor code into clear core, contracts and node namespaces. Move services into clear implementation and api sides. Push unit tests down to lowest level of dependency hierarchy possible. 2016-05-20 16:42:59 +01:00
Matthew Nesbit
a556dfb17d Push internal subsystems into node 2016-05-20 16:42:56 +01:00
Matthew Nesbit
06f4c6ab5b Move test to core as part of tidy up. 2016-05-19 14:10:25 +01:00
Matthew Nesbit
097a520e05 Push unit tests that needed some contract functionality into core by embedding the minimal contract support needed. 2016-05-19 14:01:38 +01:00
Matthew Nesbit
01e9536444 Refactor code into clear core, contracts and node namespaces. Move services into clear implementation and api sides. Push unit tests down to lowest level of dependency hierarchy possible. 2016-05-19 10:59:10 +01:00
Matthew Nesbit
c8130581a9 Push internal subsystems into node 2016-05-19 10:59:07 +01:00
rick.parker
041aab5af0 Serialization tokenization support for large objects (e.g. entries in ServiceHub) 2016-05-18 10:25:50 +01:00
Andrius Dagys
e8ae3be38d TwoPartyDealProtocol fix: don't check Notary identity if the transaction has no inputs 2016-05-18 10:06:30 +01:00
Andrius Dagys
4affe7271b Seller: Verify that the Notary signature received from the Buyer is by the correct Notary 2016-05-17 12:14:14 +01:00
Andrius Dagys
f363439a6c NotaryException now provides the specific error information 2016-05-17 12:14:14 +01:00
Matthew Nesbit
058ac986bd Move contracts base files to namespace to make api aspect clearer in includes.
Move Party to core.crypto as Party is closely aligned with the signing and used in code areas unrelated to the contract code.
2016-05-14 13:47:07 +01:00
Andrius Dagys
422d65cc54 Rearranging interfaces and implementations. Notary fix for the cash tests. 2016-05-13 16:34:25 +01:00
Andrius Dagys
2c422bebd3 Added noneOrSingle extension method, which returns a single element, null if no elements found and throws if more than one element found 2016-05-13 16:17:50 +01:00
Andrius Dagys
fa3f7e7fa6 Added a basic Notary service with protocol for signing transactions 2016-05-13 16:17:50 +01:00
Rick Parker
539e23a0b1 Merged in plt-141-moves-only-part-3 (pull request #93)
File and interface moves to core module for scheduler
2016-05-13 15:17:32 +01:00
Ross Nicoll
25e2c4bc4d Add issuance definition for cash contract
Add issuance definition for cash contract, as well as common interfaces to support later
extensions. The issuance definition encapsulates the core values for state objects when
issued, and essentially acts as the Ricardian contract for Corda states.
2016-05-13 14:55:12 +01:00
rick.parker
030f12876f Remove copyright notices from a couple of files 2016-05-13 14:12:28 +01:00
rick.parker
1ce8a64938 File and interface moves to core module 2016-05-13 14:03:28 +01:00
Rick Parker
3ee601360e Merged in plt-141-moves-only-part-2 (pull request #92)
File moves to core module and split of interfaces and implementations in preparation for further moves
2016-05-13 13:22:08 +01:00
rick.parker
e319a33b52 Added TODO to ServiceHub and CheckpointStorage 2016-05-13 12:37:39 +01:00
Mike Hearn
81c698a260 Minor: fix some compiler warnings 2016-05-13 12:58:17 +02:00
rick.parker
6017179bc0 File moves to core module and split of interfaces and implementations in preparation for further moves 2016-05-13 11:35:45 +01:00
rick.parker
a18e7b06bf File moves to core module and split of interfaces and implementations in preparation for further moves 2016-05-13 10:07:44 +01:00
Ross Nicoll
2d4c83556e Annotate verify() function to indicate it throws IllegalArgumentException 2016-05-09 18:16:33 +01:00
Ross Nicoll
642b951bae Rename PartyReference to PartyAndReference 2016-05-09 17:55:37 +01:00
Ross Nicoll
73f4803b72 Move common move command verification into a shared function 2016-05-05 11:12:25 +01:00
Ross Nicoll
47401a2a28 Merged in rnicoll-signed-data (pull request #69)
Add SignedData class
2016-04-27 13:16:42 +01:00
Ross Nicoll
7c9cff799e Add SignedData class
Adds a new SignedData class which will provide a deserialized copy of the data
contained only if the signature on it is valid.
2016-04-27 13:16:01 +01:00
Ross Nicoll
c8865c1b40 Remove deregisterIdentity()
Remove the ability to remove registered identities. Once registered, identities are part
of a permanent record (for example you would want to ensure parties to contracts cannot
"disappear" by removing themselves from the identity service).
2016-04-27 11:43:10 +01:00
Ross Nicoll
b4513e8bec Add InMemoryIdentityService
Move FixedIdentityService to MockIdentityService under testing as it's specialised for use in tests.
Add a new InMemoryIdentityService replacing the fixed identity service in AbstractNode.
2016-04-21 17:10:43 +01:00
Mike Hearn
e88907dd41 Delete unnecessary service IDs. Only services exposed to the wider network need this type of identifier. 2016-04-20 15:28:59 +02:00
Mike Hearn
fcc36c472a Improve the contracts API and Cash contract a bit, and beef up the unit tests.
Better usage of generics in groupStates so the group exposes the grouping key that was used, this avoids constructs like `val issuer = outputs[0].deposit.party` which is a bit ugly.
2016-04-20 14:36:14 +02:00
Mike Hearn
2de44a516f Switch Kryo serialisation to always include the class name, and avoid overhead from writing out SerializedBytes wrapper data.
This simplifies the serialisation code, reduces the use of inline functions, and ensures that running SerializedBytes<SuperClass>.deserialise() will correctly return SubClass if that's what it contained, efficiently.
2016-04-20 14:27:40 +02:00
Mike Hearn
105f39adb5 Minor: Rename core/.../Services.kt to AttachmentStorage.kt 2016-04-20 14:27:40 +02:00
Mike Hearn
77fd7941f9 Minor: remove a utility method that's used only once from WireTransaction 2016-04-20 14:27:40 +02:00