This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 455
Add optional data field with transaction - Closes #26 #470
Merged
4miners
merged 92 commits into
LiskArchive:1.0.0
from
SargeKhan:26-add_data_field_with_transaction
Aug 14, 2017
Merged
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
82a06c4
create setup for transactions unit tests
MaciejBaj ce63b2e
Merging @MaciejBajs 'origin/456-transactions-and-blocks-test' to use …
SargeKhan 85024a9
skipped incomplete unit tests of transcations
SargeKhan 98b8bb0
Added data column to trs table
SargeKhan a23a36f
incorporate data field in logic/transaction
SargeKhan 0fdfd6e
updated /module/trs to handle data field
SargeKhan 1345fd6
updated transaction schema for data field
SargeKhan 5b8b618
added test case for a possible bug in getbytes
SargeKhan 5e5dfdc
updated trs_view to incorporate data field
SargeKhan c70237b
included data field to cal. getByte
SargeKhan 1a04585
removed adding bytes when data field not present
SargeKhan 4db440d
updated transaction test cases
SargeKhan c522841
reverted change in getByte of transaction
SargeKhan e79aa5a
Merge branch '26-add_data_field_with_transaction' of github.com:Sarge…
SargeKhan 43b9f07
Added test cases for data in unit/transaction
SargeKhan fb5d94e
Merge branch 'development' into 26-add_data_field_with_transaction
karmacoma 1bc5a5c
replaced jslint with eslint
SargeKhan d37281b
added some test cases for /logic/transaction
SargeKhan 9c95c3c
changed data type to bytea
SargeKhan ec45c98
added api level test cases
SargeKhan b696393
removed extraneous logs
SargeKhan 472f3b9
corrected spellings
SargeKhan ee7ade8
Merge branch '26-add_data_field_with_transaction' of github.com:Sarge…
SargeKhan a32aeaa
updated getByte for data field
SargeKhan afed1d5
added fee for optional data field
SargeKhan 1b36a59
merged with upstream
SargeKhan 7c8316f
fixed calculateFee function spelling
SargeKhan 62e54e9
added unit tests for fee calculation
SargeKhan 2a716cf
Revert "merged with upstream"
SargeKhan 119cc68
resolved few failing tests, fixed formatting
SargeKhan 2c05126
resolved few failing tests
SargeKhan f71bcb4
updated calculateFee to use bignum
SargeKhan 7933a81
added a few tests
SargeKhan 8c21607
adding test cases for the rest of transaction module
SargeKhan a23cbdc
added test cases for logic/transaction
SargeKhan b0886b2
added test cases for logic/transaction
SargeKhan ba227cd
temporary commit
SargeKhan 1703cb1
added tests for transaction, setup structure for vote
SargeKhan edddc29
some tests for vote trs, refactored moduleInits
SargeKhan b9593cc
merged with development
SargeKhan 403e3b7
added test cases for votes trs
SargeKhan 9f500f1
added tests for transfer trs
SargeKhan 4356e5d
Merge branch 'development' into 26-add_data_field_with_transaction
SargeKhan ee400c4
added tests for multisignatures and second signature
SargeKhan f0a52fc
cleaned tests
SargeKhan 54791da
removed unused variables, better test statments
SargeKhan 918ef84
refactored to subtract amount from account and return error on error …
SargeKhan 56fb6a1
removed some unwanted tests
SargeKhan e7b369b
Merge remote-tracking branch 'upstream/development' into 26-add_data_…
SargeKhan 6149b81
resolved merge issues, updated git submodule to read 1.0.0 branch
SargeKhan c65e3c3
incorporated new changes in trs_list view
SargeKhan 8f98f3f
moved data field from trs header to transfer trs
SargeKhan ba373fc
merged with 1.0.0
SargeKhan 5111764
Merge branch '624-attach-transaction-asset' into 26-add_data_field_wi…
SargeKhan 1044c30
attached transfer asset query for get transaction
SargeKhan 205b243
updated position of data property as SEND trs asset
SargeKhan 06967f2
changed tab indentation to spaces
SargeKhan 8b92937
merged with dev. and updated jenkins file
SargeKhan 6fe92e1
merged with 624-attach-transaction-asset
SargeKhan 52032fd
removed some inconsistencies
SargeKhan f5b270a
accept transaction with undefined transfer asset
SargeKhan d6026a0
use 146-fee-for-optional-data for lisk-js
SargeKhan 109d424
added api tests for transfer asset edge cases
SargeKhan 62e8154
incorporated review changes
SargeKhan bb5006d
updated lisk-js version to 1.0.0
SargeKhan e4c3a84
fixed formating and grammatical errors
SargeKhan 28f0fd2
fixed comment for jenkins file
SargeKhan 1615a97
resolved merge conflicts
SargeKhan 4e083df
resolved conflicts with upstream
SargeKhan 8ac83c2
imported lisk-js 1.0.0 from github
04c0ce5
removed transaction conflicts
2851ca1
Removed conflicts for logic/transaction
7d8f7aa
Importing on lisk-js feature branch through npm
71150cf
Merged with 1.0.0
e72ec6f
Attach transfer asset for getting trs by id
3c5cb89
Fixed failing tests
73a0645
Merge remote-tracking branch 'upstream/1.0.0' into 26-add_data_field_…
c899949
Remove duplicate peer.transaction tests
79dada2
Pre-review formating and comment changes
245605c
Fixed description of transaction test and added new test
707dc47
Post review changes
d12c0e6
Fixed formating issues
bdbe7d3
Correcting grammar
0570178
Renaming dappAddFee to dappRegistrationFee
9292bdd
Normalising space
dd5076c
Creating "for transaction with data field" context
cf1007d
Revising "calculateFee" example descriptions
dca0b6f
Merge remote-tracking branch 'upstream/1.0.0' into 26-add_data_field_…
2cfaa68
Updated migrations data to today
3bb0497
Updated PR related migrations date to today
4bb9037
Merge branch '26-add_data_field_with_transaction' of github.com:Sarge…
e565471
Renamed delgate table properties in recreateFullBlockListView
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Create transfer trs table and index. | ||
*/ | ||
|
||
BEGIN; | ||
|
||
CREATE TABLE IF NOT EXISTS "transfer" ( | ||
"data" BYTEA NOT NULL, | ||
"transactionId" VARCHAR(20) NOT NULL, | ||
FOREIGN KEY("transactionId") REFERENCES "trs"("id") ON DELETE CASCADE | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS "transfer_trs_id" ON "transfer"("transactionId"); | ||
|
||
COMMIT; |
67 changes: 67 additions & 0 deletions
67
sql/migrations/20170814144034_recreateFullBlockListView.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/** | ||
* Recreate full_blocks_list, add join for transfer table. | ||
*/ | ||
|
||
BEGIN; | ||
|
||
DROP VIEW IF EXISTS full_blocks_list; | ||
|
||
CREATE VIEW full_blocks_list AS | ||
|
||
SELECT b."id" AS "b_id", | ||
b."version" AS "b_version", | ||
b."timestamp" AS "b_timestamp", | ||
b."height" AS "b_height", | ||
b."previousBlock" AS "b_previousBlock", | ||
b."numberOfTransactions" AS "b_numberOfTransactions", | ||
(b."totalAmount")::bigint AS "b_totalAmount", | ||
(b."totalFee")::bigint AS "b_totalFee", | ||
(b."reward")::bigint AS "b_reward", | ||
b."payloadLength" AS "b_payloadLength", | ||
ENCODE(b."payloadHash", 'hex') AS "b_payloadHash", | ||
ENCODE(b."generatorPublicKey", 'hex') AS "b_generatorPublicKey", | ||
ENCODE(b."blockSignature", 'hex') AS "b_blockSignature", | ||
t."id" AS "t_id", | ||
t."rowId" AS "t_rowId", | ||
t."type" AS "t_type", | ||
t."timestamp" AS "t_timestamp", | ||
ENCODE(t."senderPublicKey", 'hex') AS "t_senderPublicKey", | ||
t."senderId" AS "t_senderId", | ||
t."recipientId" AS "t_recipientId", | ||
(t."amount")::bigint AS "t_amount", | ||
(t."fee")::bigint AS "t_fee", | ||
ENCODE(t."signature", 'hex') AS "t_signature", | ||
ENCODE(t."signSignature", 'hex') AS "t_signSignature", | ||
ENCODE(s."publicKey", 'hex') AS "s_publicKey", | ||
d."name" AS "d_username", | ||
v."votes" AS "v_votes", | ||
m."min" AS "m_min", | ||
m."lifetime" AS "m_lifetime", | ||
m."keysgroup" AS "m_keysgroup", | ||
dapp."name" AS "dapp_name", | ||
dapp."description" AS "dapp_description", | ||
dapp."tags" AS "dapp_tags", | ||
dapp."type" AS "dapp_type", | ||
dapp."link" AS "dapp_link", | ||
dapp."category" AS "dapp_category", | ||
dapp."icon" AS "dapp_icon", | ||
it."dappId" AS "in_dappId", | ||
ot."dappId" AS "ot_dappId", | ||
ot."outTransactionId" AS "ot_outTransactionId", | ||
ENCODE(t."requesterPublicKey", 'hex') AS "t_requesterPublicKey", | ||
CONVERT_FROM(tf."data", 'utf8') AS "tf_data", | ||
t."signatures" AS "t_signatures" | ||
|
||
FROM blocks b | ||
|
||
LEFT OUTER JOIN trs AS t ON t."blockId" = b."id" | ||
LEFT OUTER JOIN delegates AS d ON d."tx_id" = t."id" | ||
LEFT OUTER JOIN votes AS v ON v."transactionId" = t."id" | ||
LEFT OUTER JOIN signatures AS s ON s."transactionId" = t."id" | ||
LEFT OUTER JOIN multisignatures AS m ON m."transactionId" = t."id" | ||
LEFT OUTER JOIN dapps AS dapp ON dapp."transactionId" = t."id" | ||
LEFT OUTER JOIN intransfer AS it ON it."transactionId" = t."id" | ||
LEFT OUTER JOIN outtransfer AS ot ON ot."transactionId" = t."id" | ||
LEFT OUTER JOIN transfer AS tf ON tf."transactionId" = t."id"; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tosch110 @SargeKhan could you explain the reason you aren't using a published verion of
lisk-js
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this PR introduces a new field (i.e. data property) with type 0 transaction, which isn't acceptable by the network until lisk core 1.0.0 is released. So, we can't use a published version of lisk-js. @Tosch110 will probably merge this branch with lisk-js 1.0.0 branch, and then I'll update this line.