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
@@ -0,0 +1,4 @@
BEGIN;
ALTER TABLE tokenaccount DROP COLUMN connector;
ALTER TABLE tokentransfer DROP COLUMN connector;
COMMIT;
17 changes: 17 additions & 0 deletions db/migrations/postgres/000033_add_token_connector_fields.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
BEGIN;

ALTER TABLE tokenaccount ADD COLUMN connector VARCHAR(64);
ALTER TABLE tokentransfer ADD COLUMN connector VARCHAR(64);

UPDATE tokenaccount SET connector = pool.connector
FROM (SELECT protocol_id, connector FROM tokenpool) AS pool
WHERE tokenaccount.pool_protocol_id = pool.protocol_id;

UPDATE tokentransfer SET connector = pool.connector
FROM (SELECT protocol_id, connector FROM tokenpool) AS pool
WHERE tokentransfer.pool_protocol_id = pool.protocol_id;

ALTER TABLE tokenaccount ALTER COLUMN connector SET NOT NULL;
ALTER TABLE tokentransfer ALTER COLUMN connector SET NOT NULL;

COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN;
ALTER TABLE tokenaccount RENAME COLUMN key TO identity;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN;
ALTER TABLE tokenaccount RENAME COLUMN identity TO key;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN;
ALTER TABLE tokenaccount DROP COLUMN updated;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;
ALTER TABLE tokenaccount ADD COLUMN updated BIGINT;
UPDATE tokenaccount SET updated = 0;
ALTER TABLE tokenaccount ALTER COLUMN updated SET NOT NULL;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN;
ALTER TABLE tokenpool DROP COLUMN standard;
COMMIT;
3 changes: 3 additions & 0 deletions db/migrations/postgres/000036_add_tokenpool_standard.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN;
ALTER TABLE tokenpool ADD COLUMN standard VARCHAR(64);
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE tokenaccount DROP COLUMN connector;
ALTER TABLE tokentransfer DROP COLUMN connector;
11 changes: 11 additions & 0 deletions db/migrations/sqlite/000033_add_token_connector_fields.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
DELETE FROM tokenaccount;
ALTER TABLE tokenaccount ADD COLUMN connector VARCHAR(64);
ALTER TABLE tokentransfer ADD COLUMN connector VARCHAR(64);

UPDATE tokenaccount SET connector = pool.connector
FROM (SELECT protocol_id, connector FROM tokenpool) AS pool
WHERE tokenaccount.pool_protocol_id = pool.protocol_id;

UPDATE tokentransfer SET connector = pool.connector
FROM (SELECT protocol_id, connector FROM tokenpool) AS pool
WHERE tokentransfer.pool_protocol_id = pool.protocol_id;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE tokenaccount RENAME COLUMN key TO identity;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE tokenaccount RENAME COLUMN identity TO key;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE tokenaccount DROP COLUMN updated;
2 changes: 2 additions & 0 deletions db/migrations/sqlite/000035_add_tokenaccount_updated.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE tokenaccount ADD COLUMN updated BIGINT;
UPDATE tokenaccount SET updated = 0;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE tokenpool DROP COLUMN standard;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE tokenpool ADD COLUMN standard VARCHAR(64);
86 changes: 82 additions & 4 deletions docs/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4330,6 +4330,11 @@ paths:
name: protocolid
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: standard
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: symbol
Expand Down Expand Up @@ -4397,6 +4402,8 @@ paths:
type: string
protocolId:
type: string
standard:
type: string
symbol:
type: string
tx:
Expand Down Expand Up @@ -4483,6 +4490,8 @@ paths:
type: string
protocolId:
type: string
standard:
type: string
symbol:
type: string
tx:
Expand Down Expand Up @@ -4516,6 +4525,8 @@ paths:
type: string
protocolId:
type: string
standard:
type: string
symbol:
type: string
tx:
Expand Down Expand Up @@ -4583,6 +4594,8 @@ paths:
type: string
protocolId:
type: string
standard:
type: string
symbol:
type: string
tx:
Expand Down Expand Up @@ -4635,7 +4648,12 @@ paths:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: identity
name: connector
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: key
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
Expand All @@ -4648,6 +4666,11 @@ paths:
name: tokenindex
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: updated
schema:
type: string
- description: Sort field. For multi-field sort use comma separated values (or
multiple query values) with '-' prefix for descending
in: query
Expand Down Expand Up @@ -4690,12 +4713,15 @@ paths:
items:
properties:
balance: {}
identity:
connector:
type: string
key:
type: string
poolProtocolId:
type: string
tokenIndex:
type: string
updated: {}
type: object
type: array
description: Success
Expand Down Expand Up @@ -4743,6 +4769,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -4865,6 +4893,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -4896,6 +4926,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -4965,6 +4997,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -5087,6 +5121,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -5118,6 +5154,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -5181,6 +5219,11 @@ paths:
name: amount
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: connector
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: created
Expand Down Expand Up @@ -5268,6 +5311,8 @@ paths:
items:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -5337,6 +5382,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -5459,6 +5506,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -5490,6 +5539,8 @@ paths:
schema:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down Expand Up @@ -5543,7 +5594,12 @@ paths:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: identity
name: connector
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: key
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
Expand All @@ -5556,6 +5612,11 @@ paths:
name: tokenindex
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: updated
schema:
type: string
- description: Sort field. For multi-field sort use comma separated values (or
multiple query values) with '-' prefix for descending
in: query
Expand Down Expand Up @@ -5598,12 +5659,15 @@ paths:
items:
properties:
balance: {}
identity:
connector:
type: string
key:
type: string
poolProtocolId:
type: string
tokenIndex:
type: string
updated: {}
type: object
type: array
description: Success
Expand Down Expand Up @@ -5696,6 +5760,11 @@ paths:
name: protocolid
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: standard
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: symbol
Expand Down Expand Up @@ -5763,6 +5832,8 @@ paths:
type: string
protocolId:
type: string
standard:
type: string
symbol:
type: string
tx:
Expand Down Expand Up @@ -5802,6 +5873,11 @@ paths:
name: amount
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: connector
schema:
type: string
- description: 'Data filter field. Prefixes supported: > >= < <= @ ^ ! !@ !^'
in: query
name: created
Expand Down Expand Up @@ -5889,6 +5965,8 @@ paths:
items:
properties:
amount: {}
connector:
type: string
created: {}
from:
type: string
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_post_token_burn.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var postTokenBurn = &oapispec.Route{
FilterFactory: nil,
Description: i18n.MsgTBD,
JSONInputValue: func() interface{} { return &fftypes.TokenTransferInput{} },
JSONInputMask: []string{"Type", "LocalID", "PoolProtocolID", "To", "ProtocolID", "MessageHash", "TX", "Created"},
JSONInputMask: []string{"Type", "LocalID", "PoolProtocolID", "To", "ProtocolID", "MessageHash", "Connector", "TX", "Created"},
JSONOutputValue: func() interface{} { return &fftypes.TokenTransfer{} },
JSONOutputCodes: []int{http.StatusAccepted, http.StatusOK},
JSONHandler: func(r *oapispec.APIRequest) (output interface{}, err error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_post_token_mint.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var postTokenMint = &oapispec.Route{
FilterFactory: nil,
Description: i18n.MsgTBD,
JSONInputValue: func() interface{} { return &fftypes.TokenTransferInput{} },
JSONInputMask: []string{"Type", "LocalID", "PoolProtocolID", "TokenIndex", "From", "ProtocolID", "MessageHash", "TX", "Created"},
JSONInputMask: []string{"Type", "LocalID", "PoolProtocolID", "TokenIndex", "From", "ProtocolID", "MessageHash", "Connector", "TX", "Created"},
JSONOutputValue: func() interface{} { return &fftypes.TokenTransfer{} },
JSONOutputCodes: []int{http.StatusAccepted, http.StatusOK},
JSONHandler: func(r *oapispec.APIRequest) (output interface{}, err error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_post_token_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var postTokenPool = &oapispec.Route{
FilterFactory: nil,
Description: i18n.MsgTBD,
JSONInputValue: func() interface{} { return &fftypes.TokenPool{} },
JSONInputMask: []string{"ID", "Namespace", "ProtocolID", "TX", "Connector", "Message", "Created"},
JSONInputMask: []string{"ID", "Namespace", "Standard", "ProtocolID", "TX", "Connector", "Message", "Created"},
JSONOutputValue: func() interface{} { return &fftypes.TokenPool{} },
JSONOutputCodes: []int{http.StatusAccepted, http.StatusOK},
JSONHandler: func(r *oapispec.APIRequest) (output interface{}, err error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_post_token_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var postTokenTransfer = &oapispec.Route{
FilterFactory: nil,
Description: i18n.MsgTBD,
JSONInputValue: func() interface{} { return &fftypes.TokenTransferInput{} },
JSONInputMask: []string{"Type", "LocalID", "PoolProtocolID", "ProtocolID", "MessageHash", "TX", "Created"},
JSONInputMask: []string{"Type", "LocalID", "PoolProtocolID", "ProtocolID", "MessageHash", "Connector", "TX", "Created"},
JSONOutputValue: func() interface{} { return &fftypes.TokenTransfer{} },
JSONOutputCodes: []int{http.StatusAccepted, http.StatusOK},
JSONHandler: func(r *oapispec.APIRequest) (output interface{}, err error) {
Expand Down
Loading