Open
Description
Description
Create a transaction type to create blockchain object. This transaction type should have the following body fields:
- BlockchainObjectBalance - int64
- BlockchainObjectImmutableProperty: [
key: string,
value: string,
]
There will be 2 additional table to manage blockchain object:
- blockchain_object
no | field | db_type |
---|---|---|
1 | id | []byte |
2 | owner | []byte |
3 | height | uint32 |
- blockchain_object_property [immutable-property of blockchain object]
no | field | db_type |
---|---|---|
1 | blockchain_object_id | []byte |
2 | key | string |
3 | value | string |
4 | height | uint32 |
Behaviour
-
ApplyUnconfirmed
- Deduct
tx.fee + blockchain_object_balance
from sender spendable balance (even if the sender is blockchain object too)
- Deduct
-
UndoApplyUnconfirmed
- refund the cut balance
-
ApplyConfirmed
- Deduct
tx.fee + blockchain_object_balance
from sender balance (even if the sender is blockchain object too) - generate new
blockchain_object_id
which is[4byte_blockchain_object_accountType][32bytes_tx_hash]
- insert blockchainObject { owner: tx.Sender, id: blockchain_object_id } to
blockchain_object
table. - insert new row in
account_balance
table, where the address isblockchain_object_id
- insert every blockchain object's property to
blockchain_object_property
table.
- Deduct
Breakdown
- update migration
- create bo transaction type.
Additional Diagram / File
Put additional diagram or file