Merge branch 'rigel/stake-spec-compliance' of https://github.com/cosmos/cosmos-sdk into rigel/stake-spec-compliance

This commit is contained in:
rigelrozanski 2018-07-02 20:08:55 -04:00
commit 96f2d2983b
2 changed files with 9 additions and 9 deletions

View File

@ -162,6 +162,7 @@ func (k Keeper) GetRedelegationsFromValidator(ctx sdk.Context, valAddr sdk.Addre
fmt.Println("called")
//redelegationKey := iterator.Value()
iKey := iterator.Key()
fmt.Println("LEN IT", len(iKey))
redelegationKey := GetREDKeyFromValSrcIndexKey(iKey)
fmt.Printf("debug iteratorValue: %v\n", iterator.Value())
fmt.Printf("debug iteratorKey: %v\n", iKey)

View File

@ -162,12 +162,13 @@ func GetUBDsByValIndexKey(validatorAddr sdk.Address) []byte {
func GetREDKey(delegatorAddr, validatorSrcAddr,
validatorDstAddr sdk.Address) []byte {
return append(
GetREDsKey(delegatorAddr),
append(
validatorSrcAddr.Bytes(),
validatorDstAddr.Bytes()...)...,
)
fmt.Println("KEY", delegatorAddr.Bytes())
key := make([]byte, len(delegatorAddr.Bytes()))
copy(key, delegatorAddr.Bytes())
return append(append(
GetREDsKey(key), validatorSrcAddr.Bytes()...),
validatorDstAddr.Bytes()...)
}
// get the index-key for a redelegation, stored by source-validator-index
@ -206,9 +207,7 @@ func GetREDKeyFromValSrcIndexKey(IndexKey []byte) []byte {
valSrcAddr := addrs[:split]
delAddr := addrs[split : 2*split]
valDstAddr := addrs[2*split:]
fmt.Printf("debug delAddr: %v\n", delAddr)
fmt.Printf("debug valSrcAddr: %v\n", valSrcAddr)
fmt.Printf("debug valDstAddr: %v\n", valDstAddr)
return GetREDKey(delAddr, valSrcAddr, valDstAddr)
}