Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
Osmosis_Sync
Commits
86e429d8
Commit
86e429d8
authored
2 years ago
by
Alpin Yukseloglu
Browse files
Options
Download
Email Patches
Plain Diff
revert to original app setup and fix typecast check
parent
bf9b003a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmd/osmosisd/cmd/balances_from_state_export.go
+5
-15
cmd/osmosisd/cmd/balances_from_state_export.go
with
5 additions
and
15 deletions
+5
-15
cmd/osmosisd/cmd/balances_from_state_export.go
+
5
-
15
View file @
86e429d8
...
...
@@ -321,6 +321,7 @@ Example:
app
:=
app
.
Setup
(
false
)
ctx
:=
app
.
BaseApp
.
NewContext
(
false
,
tmproto
.
Header
{
Height
:
1
,
Time
:
time
.
Now
()
.
UTC
()})
// Remove module accounts from snapshots
for
addr
,
account
:=
range
snapshotAccs
{
accAddr
,
err
:=
sdk
.
AccAddressFromBech32
(
account
.
Address
)
...
...
@@ -329,22 +330,11 @@ Example:
}
acc
:=
app
.
AccountKeeper
.
GetAccount
(
ctx
,
accAddr
)
err
=
*
authtypes
.
ModuleAccount
(
acc
)
//
If there IS an error (meaning acc is NOT a module account), continue to next acc (i.e. don't remove)
if
err
!=
nil
{
continue
if
_
,
ok
:=
acc
.
(
*
authtypes
.
ModuleAccount
);
ok
{
//
Else, remove account from list - how do we remove an item from a map in go?
//ASSUMING THAT "addr" IS THE KEY
delete
(
snapshotAccs
,
addr
)
}
//Repeat same casting/error check but w/o * in front of the cast, just to be comprehensive
err
=
authtypes
.
ModuleAccount
(
acc
)
//If there IS an error (meaning acc is NOT a module account), continue to next acc (i.e. don't remove)
if
err
!=
nil
{
continue
}
//Else, remove account from list - how do we remove an item from a map in go?
//ASSUMING THAT "addr" IS THE KEY
delete
(
snapshotAccs
,
addr
)
}
snapshot
:=
DeriveSnapshot
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets