-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-network support in ERC20 driver
- Loading branch information
Showing
15 changed files
with
388 additions
and
220 deletions.
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
29 changes: 29 additions & 0 deletions
29
core/payment-driver/gnt/migrations/2021-01-18-154920_network_id/down.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,29 @@ | ||
-- HACK: All this code below is just to drop column network from table gnt_driver_payment | ||
|
||
PRAGMA foreign_keys=off; | ||
|
||
CREATE TABLE gnt_driver_payment_tmp | ||
( | ||
order_id VARCHAR(50) NOT NULL PRIMARY KEY, | ||
-- U256 in big endian hex | ||
amount VARCHAR(64) NOT NULL, | ||
-- U256 in big endian hex | ||
gas VARCHAR(64) NOT NULL, | ||
sender VARCHAR(40) NOT NULL, | ||
recipient VARCHAR(40) NOT NULL, | ||
payment_due_date DATETIME NOT NULL, | ||
status INTEGER NOT NULL, | ||
tx_id VARCHAR(128), | ||
FOREIGN KEY(tx_id) REFERENCES gnt_driver_transaction (tx_id), | ||
FOREIGN KEY(status) REFERENCES gnt_driver_payment_status (status_id) | ||
); | ||
|
||
INSERT INTO gnt_driver_payment_tmp(order_id, amount, gas, sender, recipient, payment_due_date, status, tx_id) | ||
SELECT order_id, amount, gas, sender, recipient, payment_due_date, status, tx_id FROM gnt_driver_payment; | ||
|
||
|
||
DROP TABLE gnt_driver_payment; | ||
|
||
ALTER TABLE gnt_driver_payment_tmp RENAME TO gnt_driver_payment; | ||
|
||
PRAGMA foreign_keys=on; |
1 change: 1 addition & 0 deletions
1
core/payment-driver/gnt/migrations/2021-01-18-154920_network_id/up.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 @@ | ||
ALTER TABLE gnt_driver_payment ADD COLUMN network INTEGER NOT NULL DEFAULT 4; -- 4 is rinkeby's network ID |
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
Oops, something went wrong.