Skip to content

Commit

Permalink
Store persistent address in WAL (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
outofforest authored Nov 29, 2024
1 parent a769228 commit df15490
Show file tree
Hide file tree
Showing 12 changed files with 1,163 additions and 1,396 deletions.
18 changes: 9 additions & 9 deletions benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ func BenchmarkBalanceTransfer(b *testing.B) {
fmt.Println(s.Stats())
fmt.Println("===========================")

v := s.Find(txtypes.GenesisAccount, hashBuff, hashMatches)
require.True(b, v.Exists(hashBuff, hashMatches))
require.Equal(b, txtypes.Amount(numOfAddresses*balance), v.Value(hashBuff, hashMatches))
genesisBalance, genesisExists := s.Query(txtypes.GenesisAccount, hashBuff, hashMatches)
require.True(b, genesisExists)
require.Equal(b, txtypes.Amount(numOfAddresses*balance), genesisBalance)
}()

txIndex := 0
Expand Down Expand Up @@ -175,14 +175,14 @@ func BenchmarkBalanceTransfer(b *testing.B) {
func() {
fmt.Println(s.Stats())

v := s.Find(txtypes.GenesisAccount, hashBuff, hashMatches)
require.True(b, v.Exists(hashBuff, hashMatches))
require.Equal(b, txtypes.Amount(0), v.Value(hashBuff, hashMatches))
genesisBalance, genesisExists := s.Query(txtypes.GenesisAccount, hashBuff, hashMatches)
require.True(b, genesisExists)
require.Equal(b, txtypes.Amount(0), genesisBalance)

for _, addr := range accounts {
v := s.Find(addr, hashBuff, hashMatches)
require.True(b, v.Exists(hashBuff, hashMatches))
require.Equal(b, txtypes.Amount(balance), v.Value(hashBuff, hashMatches))
accBalance, accExists := s.Query(addr, hashBuff, hashMatches)
require.True(b, accExists)
require.Equal(b, txtypes.Amount(balance), accBalance)
}
}()
}()
Expand Down
Loading

0 comments on commit df15490

Please sign in to comment.