Skip to content
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

perf: x/bank create reverse prefix for denom<->address #9611

Merged
merged 32 commits into from
Jul 26, 2021
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
72ada0e
x/bank: create reverse prefix for denom<->address
alexanderbez Jun 29, 2021
9b5f92e
x/bank: update DenomOwners
alexanderbez Jun 29, 2021
cf595e2
x/bank: lint++
alexanderbez Jun 29, 2021
72a1ad1
x/bank: store 0 instead of balance
alexanderbez Jun 30, 2021
01e476d
Update x/bank/types/key.go
alexanderbez Jun 30, 2021
567f228
x/bank: update initBalances
alexanderbez Jun 30, 2021
e3cd0e7
x/bank: update spec
alexanderbez Jun 30, 2021
7312e5b
x/bank: add v0.44 legacy migration
alexanderbez Jun 30, 2021
2f00b31
x/bank: bump ConsensusVersion to 3
alexanderbez Jun 30, 2021
67db855
x/bank: update RegisterServices
alexanderbez Jul 1, 2021
ff041be
x/bank: fix legacy types
alexanderbez Jul 1, 2021
c3ed09f
x/bank: add TestMigrateStore
alexanderbez Jul 1, 2021
c1b4d82
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 1, 2021
313d902
fix TestRunMigrations
amaury1093 Jul 5, 2021
56e11bd
Update x/bank/types/key.go
alexanderbez Jul 5, 2021
54eac65
x/bank: improve naming
alexanderbez Jul 5, 2021
afeffcc
x/bank: add Has check
alexanderbez Jul 5, 2021
2cd4fe8
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 5, 2021
b2bc4f6
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 6, 2021
e2073ac
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 6, 2021
549a022
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 7, 2021
6cccd68
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 11, 2021
4aa6bac
attempt fix TestSignWithMultiSignersAminoJSON
alexanderbez Jul 11, 2021
fef3b67
attempt fix TestSignWithMultiSignersAminoJSON
alexanderbez Jul 12, 2021
83b7019
attempt fix TestNewRedelegateCmd
alexanderbez Jul 12, 2021
5cb8538
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 12, 2021
67b5960
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 18, 2021
f3aeb56
fix build
alexanderbez Jul 18, 2021
9a851f9
Fix delegation query test
amaury1093 Jul 26, 2021
5ada740
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 26, 2021
290e1d7
ci++
alexanderbez Jul 26, 2021
a1fa863
Merge branch 'master' into bez/9590-x-bank-denom-reverse-idx
alexanderbez Jul 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
x/bank: store 0 instead of balance
  • Loading branch information
alexanderbez committed Jun 30, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 72a1ad1fdcf7b975d44c5d187dc79629b6101c2a
7 changes: 1 addition & 6 deletions x/bank/keeper/grpc_query.go
Original file line number Diff line number Diff line change
@@ -192,16 +192,11 @@ func (k BaseKeeper) DenomOwners(
return false, err
}

var balance sdk.Coin
if err := k.cdc.Unmarshal(value, &balance); err != nil {
return false, err
}

denomOwners = append(
denomOwners,
&types.DenomOwner{
Address: address.String(),
Balance: balance,
Balance: k.GetBalance(ctx, address, req.Denom),
},
)
}
5 changes: 3 additions & 2 deletions x/bank/keeper/send.go
Original file line number Diff line number Diff line change
@@ -265,8 +265,9 @@ func (k BaseSendKeeper) setBalance(ctx sdk.Context, addr sdk.AccAddress, balance
bz := k.cdc.MustMarshal(&balance)
accountStore.Set([]byte(balance.Denom), bz)

// store a reverse index from denomination to account address
denomPrefixStore.Set(address.MustLengthPrefix(addr), bz)
// Store a reverse index from denomination to account address with a
// sentinel value.
denomPrefixStore.Set(address.MustLengthPrefix(addr), []byte{0})
}

return nil