-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Put settings in a table with schema #1746
Conversation
Pull Request Checklist
|
Jenkins BuildsClick to see older builds (132)
|
2ae0b60
to
9a15602
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also the os.MkdirAll
issue from the audit (https://github.com/status-im/trailofbits-audit/issues/41). Maybe this should be a diff PR, but fixing the file permissions in this one is a start in the right direction.
f284a79
to
2f040c2
Compare
@adambabik could you have a look? Ideally we'd want this branch to be merged today |
@corpetty is your change still requested? |
cf556fc
to
3a81962
Compare
36f2faa
to
90071b7
Compare
ChaosMode bool `json:"chaos-mode?,omitempty"` | ||
Currency string `json:"currency,omitempty"` | ||
CurrentNetwork string `json:"networks/current-network"` | ||
CustomBootnodes *json.RawMessage `json:"custom-boot-nodes,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json.RawMessage
is alias of []byte
so it's already a pointer because slices are pointers. json.RawMessage
should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's because it's not just json.RawMessage it can also be nil, when calling getSettings if it's not a pointer you get:
Error: Received unexpected error:
sql: Scan error on column index 4, name "custom_bootnodes": unsupported Scan, storing driver.Value type <nil> into type *json.RawMessage
df7eb10
to
3d3cab8
Compare
This reverts commit e8d7149.
Move settings table schema from a key-value store to a one row table with many columns.
We now save the first raw with initial data in saveAccountAndLogin and follow up saveSetting calls are only saving one setting at a time.