Skip to content

Commit

Permalink
SDK v0.42.9 - Tendermint v0.34.11
Browse files Browse the repository at this point in the history
Fixing bug related  with State Sync, IBC, adding client.toml support
  • Loading branch information
RaulBernal authored Aug 9, 2021
1 parent b06fb08 commit 609b15f
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 177 deletions.
2 changes: 1 addition & 1 deletion cmd/bcnad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func main() {
app.DefaultNodeHome,
app.Name,
app.ModuleBasics,
app.New,
app.New,
// this line is used by starport scaffolding # root/arguments
)
if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil {
Expand Down
7 changes: 2 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@ module github.com/BitCannaGlobal/bcna
go 1.16

require (
github.com/cosmos/cosmos-sdk v0.42.7
github.com/cosmos/cosmos-sdk v0.42.9
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.6 // indirect
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 // indirect
github.com/regen-network/cosmos-proto v0.3.1 // indirect
github.com/spf13/cast v1.3.1
github.com/spf13/cobra v1.1.3
github.com/stretchr/testify v1.7.0
github.com/tendermint/spm v0.0.0-20210625155357-5a2c8d79013b
github.com/tendermint/spm v0.1.3
github.com/tendermint/tendermint v0.34.11
github.com/tendermint/tm-db v0.6.4
google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced
google.golang.org/grpc v1.38.0
google.golang.org/grpc/cmd/protoc-gen-go-grpc v0.0.0-20200527211525-6c9e30c09db2 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

Expand Down
171 changes: 4 additions & 167 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion x/bcna/keeper/bitcannaid.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
)

// GetBitcannaidCount get the total number of TypeName.LowerCamel
// GetBitcannaidCount get the total number of bitcannaid
func (k Keeper) GetBitcannaidCount(ctx sdk.Context) uint64 {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BitcannaidCountKey))
byteKey := types.KeyPrefix(types.BitcannaidCountKey)
Expand Down
1 change: 1 addition & 0 deletions x/bcna/keeper/grpc_query_bitcannaid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func TestBitcannaidQuerySingle(t *testing.T) {
if tc.err != nil {
require.ErrorIs(t, err, tc.err)
} else {
require.NoError(t, err)
require.Equal(t, tc.response, response)
}
})
Expand Down
1 change: 1 addition & 0 deletions x/bcna/keeper/grpc_query_supplychain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func TestSupplychainQuerySingle(t *testing.T) {
if tc.err != nil {
require.ErrorIs(t, err, tc.err)
} else {
require.NoError(t, err)
require.Equal(t, tc.response, response)
}
})
Expand Down
2 changes: 1 addition & 1 deletion x/bcna/keeper/supplychain.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
)

// GetSupplychainCount get the total number of TypeName.LowerCamel
// GetSupplychainCount get the total number of supplychain
func (k Keeper) GetSupplychainCount(ctx sdk.Context) uint64 {
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SupplychainCountKey))
byteKey := types.KeyPrefix(types.SupplychainCountKey)
Expand Down
10 changes: 8 additions & 2 deletions x/bcna/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,26 @@ func (gs GenesisState) Validate() error {
// this line is used by starport scaffolding # genesis/types/validate
// Check for duplicated ID in supplychain
supplychainIdMap := make(map[uint64]bool)

supplychainCount := gs.GetSupplychainCount()
for _, elem := range gs.SupplychainList {
if _, ok := supplychainIdMap[elem.Id]; ok {
return fmt.Errorf("duplicated id for supplychain")
}
if elem.Id >= supplychainCount {
return fmt.Errorf("supplychain id should be lower or equal than the last id")
}
supplychainIdMap[elem.Id] = true
}
// Check for duplicated ID in bitcannaid
bitcannaidIdMap := make(map[uint64]bool)

bitcannaidCount := gs.GetBitcannaidCount()
for _, elem := range gs.BitcannaidList {
if _, ok := bitcannaidIdMap[elem.Id]; ok {
return fmt.Errorf("duplicated id for bitcannaid")
}
if elem.Id >= bitcannaidCount {
return fmt.Errorf("bitcannaid id should be lower or equal than the last id")
}
bitcannaidIdMap[elem.Id] = true
}

Expand Down

0 comments on commit 609b15f

Please sign in to comment.