feat(wallet) add scope and auto_delete to pending_transactions

Updates status-desktop #11754
This commit is contained in:
Stefan 2023-08-05 23:25:27 +01:00 committed by Stefan Dunca
parent 39fbaca5a9
commit b5373b2b4a
2 changed files with 39 additions and 4 deletions

View File

@ -2,6 +2,7 @@
// sources: // sources:
// 1691753758_initial.up.sql (5.738kB) // 1691753758_initial.up.sql (5.738kB)
// 1692701329_add_collectibles_and_collections_data_cache.up.sql (1.808kB) // 1692701329_add_collectibles_and_collections_data_cache.up.sql (1.808kB)
// 1692701339_add_scope_to_pending.up.sql (576B)
// doc.go (74B) // doc.go (74B)
package migrations package migrations
@ -86,7 +87,7 @@ func _1691753758_initialUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1691753758_initial.up.sql", size: 5738, mode: os.FileMode(0664), modTime: time.Unix(1692342414, 0)} info := bindataFileInfo{name: "1691753758_initial.up.sql", size: 5738, mode: os.FileMode(0644), modTime: time.Unix(1692625631, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6b, 0x25, 0x31, 0xc8, 0x27, 0x3, 0x6b, 0x9f, 0x15, 0x42, 0x2f, 0x85, 0xfb, 0xe3, 0x6, 0xea, 0xf7, 0x97, 0x12, 0x56, 0x3c, 0x9a, 0x5b, 0x1a, 0xca, 0xb1, 0x23, 0xfa, 0xcd, 0x57, 0x25, 0x5c}} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6b, 0x25, 0x31, 0xc8, 0x27, 0x3, 0x6b, 0x9f, 0x15, 0x42, 0x2f, 0x85, 0xfb, 0xe3, 0x6, 0xea, 0xf7, 0x97, 0x12, 0x56, 0x3c, 0x9a, 0x5b, 0x1a, 0xca, 0xb1, 0x23, 0xfa, 0xcd, 0x57, 0x25, 0x5c}}
return a, nil return a, nil
} }
@ -106,11 +107,31 @@ func _1692701329_add_collectibles_and_collections_data_cacheUpSql() (*asset, err
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1692701329_add_collectibles_and_collections_data_cache.up.sql", size: 1808, mode: os.FileMode(0664), modTime: time.Unix(1692702851, 0)} info := bindataFileInfo{name: "1692701329_add_collectibles_and_collections_data_cache.up.sql", size: 1808, mode: os.FileMode(0644), modTime: time.Unix(1692714144, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1, 0x51, 0xf4, 0x2b, 0x92, 0xde, 0x59, 0x65, 0xd8, 0x9b, 0x57, 0xe0, 0xfd, 0x7b, 0x12, 0xb, 0x29, 0x6e, 0x9d, 0xb5, 0x90, 0xe, 0xfa, 0x12, 0x97, 0xd, 0x61, 0x60, 0x7f, 0x32, 0x1d, 0xc3}} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1, 0x51, 0xf4, 0x2b, 0x92, 0xde, 0x59, 0x65, 0xd8, 0x9b, 0x57, 0xe0, 0xfd, 0x7b, 0x12, 0xb, 0x29, 0x6e, 0x9d, 0xb5, 0x90, 0xe, 0xfa, 0x12, 0x97, 0xd, 0x61, 0x60, 0x7f, 0x32, 0x1d, 0xc3}}
return a, nil return a, nil
} }
var __1692701339_add_scope_to_pendingUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x91\xcd\x8a\xdb\x30\x14\x85\xf7\x7a\x8a\xc3\xac\x5a\xb0\x5b\xba\xf6\xca\x33\x56\xa1\xe0\xda\x43\x46\x81\xd9\x19\xd5\xba\x89\xc5\xe8\x27\x48\xd7\x8d\xf3\xf6\x25\x89\x4b\x53\x1a\xe8\xec\x84\x74\xbf\x4f\xe7\x70\xcb\x12\x2f\x44\x50\xcb\x0b\x6b\x9e\x33\x6c\x00\x27\x1d\xb2\x1e\xd9\xc6\x90\x3f\x1f\x28\x18\x1b\xf6\xbc\x70\xd2\xe3\x1b\xa5\x4f\xfb\x28\xea\x56\xc9\x0d\x54\xfd\xd8\x4a\xac\xef\xc3\x2d\x84\xba\x69\x90\xaf\x3e\x25\x5f\x15\xba\x5e\xa1\xdb\xb6\x2d\x1a\xf9\xb5\xde\xb6\x0a\x0f\xcf\x57\xec\xa1\x12\xa2\x2c\xa1\x26\xc2\x51\xf3\x38\x51\xc2\xd1\x3a\x07\x3d\x73\x84\x21\x47\x4c\xe0\x89\x7e\xff\x02\x5e\x32\x78\xd2\x0c\x9d\x08\x63\x0c\x3b\x9b\x3c\x19\xc4\x84\x9d\xb6\x8e\xcc\x59\x26\x5d\x5e\xa1\x14\xcd\x3c\x52\x82\x8f\x66\x76\x74\x35\x4f\xfa\x27\xe1\x2f\xb9\x87\xd7\x61\xd6\xce\x9d\x10\xc3\x19\x1a\x29\x67\x1b\xf6\xef\xab\xf9\xd4\xb7\xdb\xef\xdd\x25\xf0\xb0\x3a\x1f\xfb\xbe\x95\x75\xf7\x6f\xeb\x2f\x95\x10\xcd\xa6\x7f\xc6\xb7\xae\x91\xaf\xb0\x66\x19\xee\x79\x2b\x21\x9e\x36\xb2\x56\xf2\x3f\x73\xa2\xef\xee\xe7\xfa\xe0\x67\xc7\xf6\xf6\x6e\xb0\xa6\xc0\x2e\x45\x3f\x68\x63\x12\xe5\x5c\x80\xe3\x9f\x73\x20\x3e\xc6\xf4\x76\x99\x62\xeb\x29\xb3\xf6\x87\x02\xf9\xe4\x7f\x44\x57\x80\x4f\x07\x2a\xd6\x85\x16\xb7\x55\x3f\x56\xe2\x57\x00\x00\x00\xff\xff\x91\x52\x81\x7e\x40\x02\x00\x00")
func _1692701339_add_scope_to_pendingUpSqlBytes() ([]byte, error) {
return bindataRead(
__1692701339_add_scope_to_pendingUpSql,
"1692701339_add_scope_to_pending.up.sql",
)
}
func _1692701339_add_scope_to_pendingUpSql() (*asset, error) {
bytes, err := _1692701339_add_scope_to_pendingUpSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "1692701339_add_scope_to_pending.up.sql", size: 576, mode: os.FileMode(0644), modTime: time.Unix(1692714144, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x36, 0x8a, 0x5e, 0xe2, 0x63, 0x15, 0x37, 0xba, 0x55, 0x18, 0xf3, 0xcc, 0xe0, 0x5, 0x84, 0xe1, 0x5b, 0xe8, 0x1, 0x32, 0x6b, 0x9f, 0x7d, 0x9f, 0xd9, 0x23, 0x6c, 0xa9, 0xb5, 0xdc, 0xf4, 0x93}}
return a, nil
}
var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xc9\xb1\x0d\xc4\x20\x0c\x05\xd0\x9e\x29\xfe\x02\xd8\xfd\x6d\xe3\x4b\xac\x2f\x44\x82\x09\x78\x7f\xa5\x49\xfd\xa6\x1d\xdd\xe8\xd8\xcf\x55\x8a\x2a\xe3\x47\x1f\xbe\x2c\x1d\x8c\xfa\x6f\xe3\xb4\x34\xd4\xd9\x89\xbb\x71\x59\xb6\x18\x1b\x35\x20\xa2\x9f\x0a\x03\xa2\xe5\x0d\x00\x00\xff\xff\x60\xcd\x06\xbe\x4a\x00\x00\x00") var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xc9\xb1\x0d\xc4\x20\x0c\x05\xd0\x9e\x29\xfe\x02\xd8\xfd\x6d\xe3\x4b\xac\x2f\x44\x82\x09\x78\x7f\xa5\x49\xfd\xa6\x1d\xdd\xe8\xd8\xcf\x55\x8a\x2a\xe3\x47\x1f\xbe\x2c\x1d\x8c\xfa\x6f\xe3\xb4\x34\xd4\xd9\x89\xbb\x71\x59\xb6\x18\x1b\x35\x20\xa2\x9f\x0a\x03\xa2\xe5\x0d\x00\x00\xff\xff\x60\xcd\x06\xbe\x4a\x00\x00\x00")
func docGoBytes() ([]byte, error) { func docGoBytes() ([]byte, error) {
@ -126,7 +147,7 @@ func docGo() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0664), modTime: time.Unix(1692342414, 0)} info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1692625631, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}}
return a, nil return a, nil
} }
@ -226,6 +247,8 @@ var _bindata = map[string]func() (*asset, error){
"1692701329_add_collectibles_and_collections_data_cache.up.sql": _1692701329_add_collectibles_and_collections_data_cacheUpSql, "1692701329_add_collectibles_and_collections_data_cache.up.sql": _1692701329_add_collectibles_and_collections_data_cacheUpSql,
"1692701339_add_scope_to_pending.up.sql": _1692701339_add_scope_to_pendingUpSql,
"doc.go": docGo, "doc.go": docGo,
} }
@ -272,6 +295,7 @@ type bintree struct {
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"1691753758_initial.up.sql": &bintree{_1691753758_initialUpSql, map[string]*bintree{}}, "1691753758_initial.up.sql": &bintree{_1691753758_initialUpSql, map[string]*bintree{}},
"1692701329_add_collectibles_and_collections_data_cache.up.sql": &bintree{_1692701329_add_collectibles_and_collections_data_cacheUpSql, map[string]*bintree{}}, "1692701329_add_collectibles_and_collections_data_cache.up.sql": &bintree{_1692701329_add_collectibles_and_collections_data_cacheUpSql, map[string]*bintree{}},
"1692701339_add_scope_to_pending.up.sql": &bintree{_1692701339_add_scope_to_pendingUpSql, map[string]*bintree{}},
"doc.go": &bintree{docGo, map[string]*bintree{}}, "doc.go": &bintree{docGo, map[string]*bintree{}},
}} }}

View File

@ -0,0 +1,11 @@
-- See TxStatus in transactions/pendingtxtracker.go
ALTER TABLE pending_transactions ADD status TEXT NOT NULL DEFAULT "Pending";
-- The watcher will auto delete the pending txs that are confirmed or failed
-- Else the producer module will have to delete them manually on processing
ALTER TABLE pending_transactions ADD COLUMN auto_delete BOOLEAN NOT NULL DEFAULT 1;
DROP INDEX idx_pending_transactions;
CREATE INDEX idx_pending_transactions
ON pending_transactions (multi_transaction_id, from_address, to_address, network_id, timestamp, symbol, type, status, auto_delete);