addresses are stored as byte array not sting (#1801)

This commit is contained in:
yenda 2020-01-15 21:33:15 +01:00 committed by GitHub
parent e11e0b5d6c
commit 0316f94907
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -1 +1 @@
0.39.4 0.39.5

View File

@ -165,8 +165,20 @@ func (db *Database) SaveSetting(setting string, value interface{}) error {
value = &sqlite.JSONBlob{value} value = &sqlite.JSONBlob{value}
update, err = db.db.Prepare("UPDATE settings SET custom_bootnodes_enabled = ? WHERE synthetic_id = 'id'") update, err = db.db.Prepare("UPDATE settings SET custom_bootnodes_enabled = ? WHERE synthetic_id = 'id'")
case "dapps-address": case "dapps-address":
str, ok := value.(string)
if ok {
value = types.HexToAddress(str)
} else {
return ErrInvalidConfig
}
update, err = db.db.Prepare("UPDATE settings SET dapps_address = ? WHERE synthetic_id = 'id'") update, err = db.db.Prepare("UPDATE settings SET dapps_address = ? WHERE synthetic_id = 'id'")
case "eip1581-address": case "eip1581-address":
str, ok := value.(string)
if ok {
value = types.HexToAddress(str)
} else {
return ErrInvalidConfig
}
update, err = db.db.Prepare("UPDATE settings SET eip1581_address = ? WHERE synthetic_id = 'id'") update, err = db.db.Prepare("UPDATE settings SET eip1581_address = ? WHERE synthetic_id = 'id'")
case "fleet": case "fleet":
update, err = db.db.Prepare("UPDATE settings SET fleet = ? WHERE synthetic_id = 'id'") update, err = db.db.Prepare("UPDATE settings SET fleet = ? WHERE synthetic_id = 'id'")