Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
BEGIN;
ALTER TABLE tokentransfer DROP COLUMN blockchain_event;
ALTER TABLE tokentransfer ADD COLUMN tx_type VARCHAR(64);
ALTER TABLE tokentransfer ADD COLUMN tx_id UUID;
COMMIT;
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
BEGIN;
ALTER TABLE tokentransfer DROP COLUMN tx_type;
ALTER TABLE tokentransfer DROP COLUMN tx_id;
ALTER TABLE tokentransfer ADD COLUMN blockchain_event UUID;
COMMIT;
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
ALTER TABLE tokentransfer DROP COLUMN blockchain_event;
ALTER TABLE tokentransfer ADD COLUMN tx_type VARCHAR(64);
ALTER TABLE tokentransfer ADD COLUMN tx_id UUID;
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
ALTER TABLE tokentransfer DROP COLUMN tx_type;
ALTER TABLE tokentransfer DROP COLUMN tx_id;
ALTER TABLE tokentransfer ADD COLUMN blockchain_event UUID;
146 changes: 146 additions & 0 deletions docs/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7439,6 +7439,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -7475,6 +7481,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -7511,6 +7523,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -7657,6 +7675,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -7693,6 +7717,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -7729,6 +7759,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -7843,6 +7879,16 @@ paths:
name: tokenindex
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: tx.id
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: tx.type
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: uri
Expand Down Expand Up @@ -7909,6 +7955,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8054,6 +8106,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8090,6 +8148,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8126,6 +8190,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8540,6 +8610,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8576,6 +8652,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8612,6 +8694,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8776,6 +8864,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8812,6 +8906,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -8848,6 +8948,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -9322,6 +9428,16 @@ paths:
name: tokenindex
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: tx.id
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: tx.type
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: uri
Expand Down Expand Up @@ -9388,6 +9504,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -9520,6 +9642,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -9556,6 +9684,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -9592,6 +9726,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down Expand Up @@ -9656,6 +9796,12 @@ paths:
type: string
tokenIndex:
type: string
tx:
properties:
id: {}
type:
type: string
type: object
type:
enum:
- mint
Expand Down
8 changes: 5 additions & 3 deletions internal/assets/token_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ func (s *transferSender) sendInternal(ctx context.Context, method sendMethod) er
Created: fftypes.Now(),
Status: fftypes.OpStatusPending,
}
s.transfer.TX.ID = tx.ID
s.transfer.TX.Type = tx.Type

op := fftypes.NewTXOperation(
plugin,
Expand Down Expand Up @@ -292,11 +294,11 @@ func (s *transferSender) sendInternal(ctx context.Context, method sendMethod) er

switch s.transfer.Type {
case fftypes.TokenTransferTypeMint:
err = plugin.MintTokens(ctx, op.ID, tx.ID, pool.ProtocolID, &s.transfer.TokenTransfer)
err = plugin.MintTokens(ctx, op.ID, pool.ProtocolID, &s.transfer.TokenTransfer)
case fftypes.TokenTransferTypeTransfer:
err = plugin.TransferTokens(ctx, op.ID, tx.ID, pool.ProtocolID, &s.transfer.TokenTransfer)
err = plugin.TransferTokens(ctx, op.ID, pool.ProtocolID, &s.transfer.TokenTransfer)
case fftypes.TokenTransferTypeBurn:
err = plugin.BurnTokens(ctx, op.ID, tx.ID, pool.ProtocolID, &s.transfer.TokenTransfer)
err = plugin.BurnTokens(ctx, op.ID, pool.ProtocolID, &s.transfer.TokenTransfer)
default:
panic(fmt.Sprintf("unknown transfer type: %v", s.transfer.Type))
}
Expand Down
Loading