-
Notifications
You must be signed in to change notification settings - Fork 3
[Feature] - Atomic Transaction #1304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
common/database/migration.go
Outdated
@@ -298,7 +298,7 @@ func (m *Migration) Init() error { | |||
`, | |||
` | |||
ALTER TABLE "transaction" | |||
ADD COLUMN "multisig_child" INTEGER DEFAULT 0 | |||
ADD COLUMN "child_type" INTEGER DEFAULT 0 -- indicate transaction has a child of transaction |
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.
it should indicates transaction is
a child instead of has
a child
common/query/transactionQuery.go
Outdated
func (tq *TransactionQuery) GetTransactionsByBlockID(blockID int64) (str string, args []interface{}) { | ||
query := fmt.Sprintf("SELECT %s FROM %s WHERE block_id = ? AND multisig_child = false "+ | ||
query := fmt.Sprintf("SELECT %s FROM %s WHERE block_id = ? AND child_type = 0 "+ |
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.
do we have constant for child_type
?
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.
not contant actually, its as enum proto message
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.
ah better to use enum instead, on it :)
common/query/transactionQuery.go
Outdated
@@ -88,7 +111,7 @@ func (tq *TransactionQuery) GetTransactionsByIds(txIds []int64) (str string, arg | |||
args = append(args, id) | |||
} | |||
return fmt.Sprintf( | |||
"SELECT %s FROM %s WHERE multisig_child = false AND id IN(?%s)", | |||
"SELECT %s FROM %s WHERE child_type = 0 AND id IN(?%s)", |
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.
child_type here should be using constant right?
Description
Atomic Transaction, new transaction type, allowing to post bulk transactions in single wrapper called
AtomicTransaction
.Similiar with
MultiSignatureTransaction
, the different part isAtomicTransaction
only offchain flow.Now
Transaction
haveChildType
indicating that transaction is a non child transaction or not.And the last added now schema for atomic and also new table called
atomic_transaction
. It will manually stored records whenTransactionType.AtomicTransaction
applying confirmed happened.Breakdown
AtomicTransaction
atomic
seed
Reference Issue
Close #1309
Reference PR
zoobc/zoobc-schema#168
Step to Test (optional)