-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into roysc/adr-040-db
- Loading branch information
Showing
142 changed files
with
928 additions
and
570 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,3 +52,5 @@ | |
- x/*/client/**/* | ||
"Type: ADR": | ||
- docs/architecture/**/* | ||
"C:container": | ||
- container/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// +build norace | ||
|
||
package client_test | ||
|
||
import ( | ||
"fmt" | ||
|
||
abci "github.com/tendermint/tendermint/abci/types" | ||
|
||
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" | ||
) | ||
|
||
func (s *IntegrationTestSuite) TestQueryABCIHeight() { | ||
|
||
testCases := []struct { | ||
name string | ||
reqHeight int64 | ||
ctxHeight int64 | ||
expHeight int64 | ||
}{ | ||
{ | ||
name: "non zero request height", | ||
reqHeight: 3, | ||
ctxHeight: 1, // query at height 1 or 2 would cause an error | ||
expHeight: 3, | ||
}, | ||
{ | ||
name: "empty request height - use context height", | ||
reqHeight: 0, | ||
ctxHeight: 3, | ||
expHeight: 3, | ||
}, | ||
{ | ||
name: "empty request height and context height - use latest height", | ||
reqHeight: 0, | ||
ctxHeight: 0, | ||
expHeight: 4, | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
s.Run(tc.name, func() { | ||
s.network.WaitForHeight(tc.expHeight) | ||
|
||
val := s.network.Validators[0] | ||
|
||
clientCtx := val.ClientCtx | ||
clientCtx = clientCtx.WithHeight(tc.ctxHeight) | ||
|
||
req := abci.RequestQuery{ | ||
Path: fmt.Sprintf("store/%s/key", banktypes.StoreKey), | ||
Height: tc.reqHeight, | ||
Data: banktypes.CreateAccountBalancesPrefix(val.Address), | ||
Prove: true, | ||
} | ||
|
||
res, err := clientCtx.QueryABCI(req) | ||
s.Require().NoError(err) | ||
|
||
s.Require().Equal(tc.expHeight, res.Height) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package container | ||
|
||
import "reflect" | ||
|
||
// ConstructorInfo defines a special constructor type that is defined by | ||
// reflection. It should be passed as a value to the Provide function. | ||
// Ex: | ||
// option.Provide(ConstructorInfo{ ... }) | ||
type ConstructorInfo struct { | ||
// In defines the in parameter types to Fn. | ||
In []reflect.Type | ||
|
||
// Out defines the out parameter types to Fn. | ||
Out []reflect.Type | ||
|
||
// Fn defines the constructor function. | ||
Fn func([]reflect.Value) []reflect.Value | ||
|
||
// Location defines the source code location to be used for this constructor | ||
// in error messages. | ||
Location Location | ||
} |
Oops, something went wrong.