Add grpc gateway missing endpoints to swagger docs (#8232)
* Add missing endpoints * Fix swagger gen * update * Update static.go * Fix format * Fix tests
This commit is contained in:
parent
ed7bd245b8
commit
6a9b0caa57
10
Makefile
10
Makefile
|
@ -176,6 +176,16 @@ go.sum: go.mod
|
|||
### Documentation ###
|
||||
###############################################################################
|
||||
|
||||
update-swagger-docs: statik
|
||||
$(BINDIR)/statik -src=client/docs/swagger-ui -dest=client/docs -f -m
|
||||
@if [ -n "$(git status --porcelain)" ]; then \
|
||||
echo "\033[91mSwagger docs are out of sync!!!\033[0m";\
|
||||
exit 1;\
|
||||
else \
|
||||
echo "\033[92mSwagger docs are in sync\033[0m";\
|
||||
fi
|
||||
.PHONY: update-swagger-docs
|
||||
|
||||
godocs:
|
||||
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/cosmos/cosmos-sdk/types"
|
||||
godoc -http=:6060
|
||||
|
|
|
@ -28,6 +28,14 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "./tmp-swagger-gen/cosmos/base/tendermint/v1beta1/query.swagger.json",
|
||||
"operationIds": {
|
||||
"rename": {
|
||||
"Params": "BaseParams"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "./tmp-swagger-gen/cosmos/distribution/v1beta1/query.swagger.json",
|
||||
"operationIds": {
|
||||
|
@ -85,6 +93,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "./tmp-swagger-gen/cosmos/tx/v1beta1/service.swagger.json",
|
||||
"dereference": {
|
||||
"circular": "ignore"
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "./tmp-swagger-gen/cosmos/upgrade/v1beta1/query.swagger.json",
|
||||
"operationIds": {
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -866,74 +866,74 @@ func init() {
|
|||
}
|
||||
|
||||
var fileDescriptor_40c93fb3ef485c5d = []byte{
|
||||
// 1059 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcf, 0x6f, 0xdc, 0xc4,
|
||||
0x17, 0x8f, 0xb3, 0x6d, 0x36, 0x79, 0xfb, 0xd5, 0x97, 0x64, 0x12, 0x1a, 0xc7, 0x4a, 0xb7, 0xc1,
|
||||
0x87, 0x36, 0x21, 0x8a, 0xad, 0xdd, 0x10, 0x0a, 0xe2, 0x97, 0x08, 0x81, 0x34, 0x6a, 0xa9, 0x22,
|
||||
0x07, 0x71, 0x40, 0x48, 0x96, 0x77, 0x3d, 0x71, 0x46, 0xd9, 0xf5, 0x4c, 0x3d, 0xe3, 0xa0, 0x15,
|
||||
0xaa, 0x40, 0xfd, 0x0b, 0x90, 0xf8, 0x17, 0x7a, 0xe1, 0x1f, 0xe0, 0x88, 0x38, 0x72, 0xa3, 0x12,
|
||||
0x12, 0xf4, 0x88, 0x12, 0xfe, 0x0a, 0x4e, 0xc8, 0x33, 0xe3, 0x5d, 0xbb, 0x49, 0xba, 0xbb, 0x39,
|
||||
0x20, 0x71, 0xf2, 0xcc, 0xfb, 0x35, 0x9f, 0xcf, 0x9b, 0xf7, 0x9e, 0x07, 0x5e, 0x6f, 0x53, 0xde,
|
||||
0xa5, 0xdc, 0x6d, 0x05, 0x1c, 0xbb, 0x02, 0xc7, 0x21, 0x4e, 0xba, 0x24, 0x16, 0xee, 0x49, 0xa3,
|
||||
0x85, 0x45, 0xd0, 0x70, 0x1f, 0xa5, 0x38, 0xe9, 0x39, 0x2c, 0xa1, 0x82, 0xa2, 0xba, 0xb2, 0x75,
|
||||
0x32, 0x5b, 0x67, 0x60, 0xeb, 0x68, 0x5b, 0x6b, 0x21, 0xa2, 0x11, 0x95, 0xa6, 0x6e, 0xb6, 0x52,
|
||||
0x5e, 0xd6, 0x52, 0x44, 0x69, 0xd4, 0xc1, 0xae, 0xdc, 0xb5, 0xd2, 0x43, 0x37, 0x88, 0x75, 0x40,
|
||||
0x6b, 0x59, 0xab, 0x02, 0x46, 0xdc, 0x20, 0x8e, 0xa9, 0x08, 0x04, 0xa1, 0x31, 0xd7, 0x5a, 0xab,
|
||||
0x00, 0x87, 0x35, 0x99, 0x2b, 0x7a, 0x0c, 0xe7, 0xba, 0xe5, 0x82, 0x4e, 0xca, 0xdd, 0x56, 0x87,
|
||||
0xb6, 0x8f, 0x2f, 0xd5, 0x16, 0x7d, 0x4b, 0x94, 0x25, 0xbf, 0x3e, 0x5b, 0x16, 0x44, 0x24, 0x96,
|
||||
0x20, 0x94, 0xad, 0xfd, 0xad, 0x01, 0xf5, 0x5d, 0x2c, 0x3e, 0x0f, 0x3a, 0x24, 0x0c, 0x04, 0x4d,
|
||||
0x0e, 0xb0, 0xd8, 0xee, 0xdd, 0xc3, 0x24, 0x3a, 0x12, 0x1e, 0x7e, 0x94, 0x62, 0x2e, 0xd0, 0x0d,
|
||||
0x98, 0x3a, 0x92, 0x02, 0xd3, 0x58, 0x31, 0x56, 0x2b, 0x9e, 0xde, 0xa1, 0x4f, 0x00, 0x06, 0xe1,
|
||||
0xcc, 0xc9, 0x15, 0x63, 0xb5, 0xd6, 0xbc, 0xed, 0x14, 0x53, 0xa8, 0x72, 0xab, 0xcf, 0x76, 0xf6,
|
||||
0x83, 0x08, 0xeb, 0x98, 0x5e, 0xc1, 0xd3, 0x7e, 0x6e, 0xc0, 0xad, 0x4b, 0x21, 0x70, 0x46, 0x63,
|
||||
0x8e, 0xd1, 0x6b, 0xf0, 0x3f, 0xc9, 0xdf, 0x2f, 0x21, 0xa9, 0x49, 0x99, 0x32, 0x45, 0x7b, 0x00,
|
||||
0x27, 0x79, 0x08, 0x6e, 0x4e, 0xae, 0x54, 0x56, 0x6b, 0xcd, 0x35, 0xe7, 0xe5, 0x37, 0xea, 0xf4,
|
||||
0x0f, 0xf5, 0x0a, 0xce, 0x68, 0xb7, 0xc4, 0xac, 0x22, 0x99, 0xdd, 0x19, 0xca, 0x4c, 0x41, 0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2, 0x17, 0xe1, 0xd5, 0x7e,
|
||||
0xc9, 0x28, 0x85, 0x42, 0x6c, 0x3f, 0x86, 0x1b, 0x2f, 0x2a, 0xfe, 0x4d, 0x5c, 0xf3, 0x30, 0xb7,
|
||||
0x8b, 0xc5, 0x41, 0x2f, 0x6e, 0x93, 0x38, 0xca, 0x31, 0x39, 0x80, 0x8a, 0x42, 0x8d, 0xc7, 0x84,
|
||||
0x2a, 0x57, 0x22, 0x09, 0x67, 0xda, 0xcb, 0xb7, 0xf6, 0x82, 0xb4, 0x7f, 0x48, 0x43, 0xbc, 0x17,
|
||||
0x1f, 0xd2, 0x3c, 0xca, 0xcf, 0x06, 0xcc, 0x97, 0xc4, 0x3a, 0xce, 0x7d, 0x98, 0x0b, 0xf1, 0x61,
|
||||
0x90, 0x76, 0x84, 0x1f, 0xd3, 0x10, 0xfb, 0x24, 0x3e, 0xa4, 0x9a, 0xe0, 0xad, 0x22, 0x5a, 0xd6,
|
||||
0x64, 0xce, 0x8e, 0x32, 0xec, 0xc7, 0x78, 0x25, 0x2c, 0x0b, 0xd0, 0x97, 0x30, 0x1f, 0x30, 0xd6,
|
||||
0x21, 0x6d, 0x59, 0xc1, 0xfe, 0x09, 0x4e, 0xf8, 0x60, 0x3e, 0xae, 0x0f, 0xed, 0x27, 0x65, 0x2e,
|
||||
0x43, 0xa3, 0x42, 0x1c, 0x2d, 0xb7, 0xff, 0x36, 0xa0, 0x56, 0xb0, 0x41, 0x08, 0xae, 0xc5, 0x41,
|
||||
0x17, 0xeb, 0x7e, 0x90, 0x6b, 0xb4, 0x04, 0xd3, 0x01, 0x63, 0xbe, 0x94, 0x4f, 0xea, 0x3e, 0x61,
|
||||
0xec, 0x61, 0xa6, 0x32, 0xa1, 0x9a, 0x03, 0xaa, 0x28, 0x8d, 0xde, 0xa2, 0x9b, 0x00, 0x11, 0x11,
|
||||
0x7e, 0x9b, 0x76, 0xbb, 0x44, 0xc8, 0x42, 0x9f, 0xf1, 0x66, 0x22, 0x22, 0x3e, 0x92, 0x82, 0x4c,
|
||||
0xdd, 0x4a, 0x49, 0x27, 0xf4, 0x45, 0x10, 0x71, 0xf3, 0xba, 0x52, 0x4b, 0xc9, 0x67, 0x41, 0xc4,
|
||||
0xa5, 0x37, 0xed, 0x73, 0x9d, 0xd2, 0xde, 0x54, 0x23, 0x45, 0x1f, 0xe7, 0xde, 0x21, 0x66, 0xdc,
|
||||
0xac, 0xca, 0xd1, 0x72, 0x7b, 0x58, 0x2a, 0x3e, 0xa5, 0x61, 0xda, 0xc1, 0xfa, 0x94, 0x1d, 0xcc,
|
||||
0xb8, 0x7d, 0x0f, 0xa6, 0x94, 0x30, 0xa3, 0xcd, 0x02, 0x71, 0x94, 0xd3, 0xce, 0xd6, 0x45, 0x6e,
|
||||
0x93, 0x65, 0x6e, 0xb3, 0x50, 0xe1, 0x69, 0x57, 0x33, 0xce, 0x96, 0xcd, 0x27, 0x33, 0x50, 0x3d,
|
||||
0xc0, 0xc9, 0x09, 0x69, 0x63, 0xf4, 0x83, 0x01, 0xb5, 0x42, 0x55, 0xa0, 0xe6, 0x30, 0x60, 0xe7,
|
||||
0x2b, 0xcb, 0xda, 0x1c, 0xcb, 0x47, 0x95, 0x9d, 0xdd, 0x78, 0xf2, 0xdb, 0x5f, 0xdf, 0x4f, 0xae,
|
||||
0xa3, 0x35, 0x77, 0xc8, 0x1b, 0xa5, 0x5f, 0x94, 0xe8, 0xa9, 0x01, 0x30, 0x68, 0x04, 0xd4, 0x18,
|
||||
0xe1, 0xd8, 0x72, 0x27, 0x59, 0xcd, 0x71, 0x5c, 0x34, 0x50, 0x57, 0x02, 0x5d, 0x43, 0x77, 0x86,
|
||||
0x01, 0xd5, 0xed, 0x87, 0x7e, 0x34, 0xe0, 0xff, 0xe5, 0x19, 0x82, 0xb6, 0x46, 0x38, 0xf7, 0xfc,
|
||||
0x30, 0xb2, 0xde, 0x1c, 0xd7, 0x4d, 0x43, 0xde, 0x92, 0x90, 0x5d, 0xb4, 0x31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ff, 0xff, 0xf6, 0xf3, 0x0e, 0x76, 0xf1,
|
||||
0x0c, 0x00, 0x00,
|
||||
// 1060 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x6f, 0xdc, 0x44,
|
||||
0x14, 0xaf, 0xb3, 0x6d, 0x36, 0x79, 0x8b, 0x20, 0x99, 0x84, 0xc6, 0xb1, 0xd2, 0x6d, 0xf0, 0xa1,
|
||||
0x4d, 0x88, 0x62, 0x6b, 0xb7, 0x6d, 0xda, 0x43, 0x29, 0x22, 0x04, 0xd2, 0xa8, 0xa5, 0x8a, 0x1c,
|
||||
0xc4, 0x01, 0x21, 0x59, 0xde, 0xf5, 0xc4, 0x19, 0x65, 0xd7, 0x33, 0xf5, 0x8c, 0x83, 0x56, 0xa8,
|
||||
0x02, 0x71, 0xe2, 0x88, 0xc4, 0x57, 0xe8, 0x85, 0x2f, 0xc0, 0x11, 0x71, 0xe4, 0x58, 0x81, 0x84,
|
||||
0x2a, 0x4e, 0x28, 0xe1, 0x53, 0x70, 0x42, 0x9e, 0x19, 0xef, 0xda, 0x4d, 0xd2, 0xdd, 0xcd, 0x01,
|
||||
0x89, 0x93, 0x67, 0xde, 0xbf, 0xf9, 0xfd, 0xde, 0xbc, 0xf7, 0x3c, 0xf0, 0x6e, 0x9b, 0xf2, 0x2e,
|
||||
0xe5, 0x6e, 0x2b, 0xe0, 0xd8, 0x15, 0x38, 0x0e, 0x71, 0xd2, 0x25, 0xb1, 0x70, 0x8f, 0x1a, 0x2d,
|
||||
0x2c, 0x82, 0x86, 0xfb, 0x34, 0xc5, 0x49, 0xcf, 0x61, 0x09, 0x15, 0x14, 0xd5, 0x95, 0xad, 0x93,
|
||||
0xd9, 0x3a, 0x03, 0x5b, 0x47, 0xdb, 0x5a, 0xf3, 0x11, 0x8d, 0xa8, 0x34, 0x75, 0xb3, 0x95, 0xf2,
|
||||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f,
|
||||
0xd4, 0x2b, 0x38, 0xa3, 0xed, 0x12, 0xb3, 0x8a, 0x64, 0x76, 0x73, 0x28, 0x33, 0x05, 0xb5, 0x44,
|
||||
0x6d, 0x1f, 0x96, 0xb6, 0xb1, 0x78, 0x1c, 0x08, 0xcc, 0x4b, 0xfc, 0xf2, 0xd4, 0x96, 0x53, 0x68,
|
||||
0x5c, 0x38, 0x85, 0x7f, 0x18, 0x70, 0xed, 0x9c, 0x83, 0xfe, 0xdf, 0x09, 0x7c, 0x6e, 0xc0, 0x74,
|
||||
0xff, 0x08, 0x64, 0x42, 0x35, 0x08, 0xc3, 0x04, 0x73, 0x2e, 0xf1, 0x4f, 0x7b, 0xf9, 0x16, 0xad,
|
||||
0x43, 0x95, 0xa5, 0x2d, 0xff, 0x10, 0xf7, 0x74, 0x21, 0xce, 0x3b, 0xaa, 0xf5, 0x9c, 0xbc, 0x2b,
|
||||
0x9d, 0x0f, 0xe2, 0x9e, 0x37, 0xc9, 0xd2, 0xd6, 0x23, 0xdc, 0xcb, 0xb2, 0x71, 0x44, 0x05, 0x89,
|
||||
0x23, 0x9f, 0xd1, 0x2f, 0x71, 0x22, 0x11, 0x56, 0xbc, 0x9a, 0x92, 0xed, 0x66, 0x22, 0xb4, 0x06,
|
||||
0xb3, 0x2c, 0xa1, 0x8c, 0x72, 0x9c, 0xf8, 0x2c, 0x21, 0x34, 0x21, 0xa2, 0x67, 0x5e, 0x96, 0x76,
|
||||
0x33, 0xb9, 0x62, 0x57, 0xcb, 0xed, 0x06, 0x2c, 0x6c, 0x63, 0xb1, 0x99, 0x25, 0x73, 0xc4, 0xee,
|
||||
0xb1, 0xbf, 0x06, 0xf3, 0xb4, 0x8b, 0xbe, 0xac, 0xdb, 0x30, 0xa5, 0x2e, 0x8b, 0x84, 0xba, 0x28,
|
||||
0x16, 0x8b, 0xb9, 0x57, 0xbd, 0x2e, 0x5d, 0x77, 0xb6, 0xbc, 0xaa, 0x34, 0xdd, 0x09, 0xd1, 0x3a,
|
||||
0x5c, 0x91, 0x4b, 0x9d, 0x81, 0x85, 0x73, 0x5c, 0x3c, 0x65, 0x65, 0x2f, 0xc0, 0xdb, 0xfd, 0x92,
|
||||
0x51, 0x0a, 0x85, 0xd8, 0x7e, 0x06, 0x57, 0x5f, 0x55, 0xfc, 0x97, 0xb8, 0xe6, 0x60, 0x76, 0x1b,
|
||||
0x8b, 0xbd, 0x5e, 0xdc, 0x26, 0x71, 0x94, 0x63, 0x72, 0x00, 0x15, 0x85, 0x1a, 0x8f, 0x09, 0x55,
|
||||
0xae, 0x44, 0x12, 0xce, 0x94, 0x97, 0x6f, 0xed, 0x79, 0x69, 0xff, 0x84, 0x86, 0x78, 0x27, 0xde,
|
||||
0xa7, 0x79, 0x94, 0x5f, 0x0c, 0x98, 0x2b, 0x89, 0x75, 0x9c, 0x47, 0x30, 0x1b, 0xe2, 0xfd, 0x20,
|
||||
0xed, 0x08, 0x3f, 0xa6, 0x21, 0xf6, 0x49, 0xbc, 0x4f, 0x35, 0xc1, 0xeb, 0x45, 0xb4, 0xac, 0xc9,
|
||||
0x9c, 0x2d, 0x65, 0xd8, 0x8f, 0xf1, 0x56, 0x58, 0x16, 0xa0, 0x2f, 0x60, 0x2e, 0x60, 0xac, 0x43,
|
||||
0xda, 0xb2, 0x82, 0xfd, 0x23, 0x9c, 0xf0, 0xc1, 0x7c, 0x5c, 0x1b, 0xda, 0x4f, 0xca, 0x5c, 0x86,
|
||||
0x46, 0x85, 0x38, 0x5a, 0x6e, 0xff, 0x63, 0x40, 0xad, 0x60, 0x83, 0x10, 0x5c, 0x8e, 0x83, 0x2e,
|
||||
0xd6, 0xfd, 0x20, 0xd7, 0x68, 0x11, 0xa6, 0x02, 0xc6, 0x7c, 0x29, 0x9f, 0xd0, 0x7d, 0xc2, 0xd8,
|
||||
0x93, 0x4c, 0x65, 0x42, 0x35, 0x07, 0x54, 0x51, 0x1a, 0xbd, 0x45, 0xd7, 0x00, 0x22, 0x22, 0xfc,
|
||||
0x36, 0xed, 0x76, 0x89, 0x90, 0x85, 0x3e, 0xed, 0x4d, 0x47, 0x44, 0x7c, 0x28, 0x05, 0x99, 0xba,
|
||||
0x95, 0x92, 0x4e, 0xe8, 0x8b, 0x20, 0xe2, 0xe6, 0x15, 0xa5, 0x96, 0x92, 0x4f, 0x83, 0x88, 0x4b,
|
||||
0x6f, 0xda, 0xe7, 0x3a, 0xa9, 0xbd, 0xa9, 0x46, 0x8a, 0x3e, 0xca, 0xbd, 0x43, 0xcc, 0xb8, 0x59,
|
||||
0x95, 0xa3, 0xe5, 0xc6, 0xb0, 0x54, 0x7c, 0x42, 0xc3, 0xb4, 0x83, 0xf5, 0x29, 0x5b, 0x98, 0x71,
|
||||
0xfb, 0x21, 0x4c, 0x2a, 0x61, 0x46, 0x9b, 0x05, 0xe2, 0x20, 0xa7, 0x9d, 0xad, 0x8b, 0xdc, 0x26,
|
||||
0xca, 0xdc, 0x66, 0xa0, 0xc2, 0xd3, 0xae, 0x66, 0x9c, 0x2d, 0x9b, 0xdf, 0x4d, 0x43, 0x75, 0x0f,
|
||||
0x27, 0x47, 0xa4, 0x8d, 0xd1, 0x8f, 0x06, 0xd4, 0x0a, 0x55, 0x81, 0x9a, 0xc3, 0x80, 0x9d, 0xae,
|
||||
0x2c, 0xeb, 0xd6, 0x58, 0x3e, 0xaa, 0xec, 0xec, 0xc6, 0xb7, 0xbf, 0xff, 0xfd, 0xc3, 0xc4, 0x1a,
|
||||
0x5a, 0x75, 0x87, 0xbc, 0x51, 0xfa, 0x45, 0x89, 0x9e, 0x1b, 0x00, 0x83, 0x46, 0x40, 0x8d, 0x11,
|
||||
0x8e, 0x2d, 0x77, 0x92, 0xd5, 0x1c, 0xc7, 0x45, 0x03, 0x75, 0x25, 0xd0, 0x55, 0x74, 0x73, 0x18,
|
||||
0x50, 0xdd, 0x7e, 0xe8, 0x27, 0x03, 0xde, 0x2c, 0xcf, 0x10, 0x74, 0x67, 0x84, 0x73, 0x4f, 0x0f,
|
||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x45, 0x97, 0xab, 0x61,
|
||||
0xd6, 0x9a, 0x94, 0xef, 0x9d, 0x5b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x08, 0x32, 0x9c, 0x36,
|
||||
0xf7, 0x0c, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
|
|
@ -546,9 +546,9 @@ var (
|
|||
|
||||
pattern_Service_GetBlockByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "blocks", "height"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Service_GetLatestValidatorSet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "validators", "latest"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
pattern_Service_GetLatestValidatorSet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "validatorsets", "latest"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Service_GetValidatorSetByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "validators", "height"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
pattern_Service_GetValidatorSetByHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "base", "tendermint", "v1beta1", "validatorsets", "height"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -117,11 +117,11 @@ func (s IntegrationTestSuite) TestQueryLatestValidatorSet() {
|
|||
s.Require().NoError(err)
|
||||
|
||||
// rest request without pagination
|
||||
_, err = rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validators/latest", val.APIAddress))
|
||||
_, err = rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest", val.APIAddress))
|
||||
s.Require().NoError(err)
|
||||
|
||||
// rest request with pagination
|
||||
restRes, err := rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validators/latest?pagination.offset=%d&pagination.limit=%d", val.APIAddress, 0, 1))
|
||||
restRes, err := rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/latest?pagination.offset=%d&pagination.limit=%d", val.APIAddress, 0, 1))
|
||||
s.Require().NoError(err)
|
||||
var validatorSetRes tmservice.GetLatestValidatorSetResponse
|
||||
s.Require().NoError(val.ClientCtx.JSONMarshaler.UnmarshalJSON(restRes, &validatorSetRes))
|
||||
|
@ -150,11 +150,11 @@ func (s IntegrationTestSuite) TestQueryValidatorSetByHeight() {
|
|||
s.Require().NoError(err)
|
||||
|
||||
// no pagination rest
|
||||
_, err = rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validators/%d", val.APIAddress, 1))
|
||||
_, err = rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d", val.APIAddress, 1))
|
||||
s.Require().NoError(err)
|
||||
|
||||
// rest query with pagination
|
||||
restRes, err := rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validators/%d?pagination.offset=%d&pagination.limit=%d", val.APIAddress, 1, 0, 1))
|
||||
restRes, err := rest.GetRequest(fmt.Sprintf("%s/cosmos/base/tendermint/v1beta1/validatorsets/%d?pagination.offset=%d&pagination.limit=%d", val.APIAddress, 1, 0, 1))
|
||||
var validatorSetRes tmservice.GetValidatorSetByHeightResponse
|
||||
s.Require().NoError(val.ClientCtx.JSONMarshaler.UnmarshalJSON(restRes, &validatorSetRes))
|
||||
}
|
||||
|
|
|
@ -32,11 +32,11 @@ service Service {
|
|||
|
||||
// GetLatestValidatorSet queries latest validator-set.
|
||||
rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) {
|
||||
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validators/latest";
|
||||
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest";
|
||||
}
|
||||
// GetValidatorSetByHeight queries validator-set at a given height.
|
||||
rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) {
|
||||
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validators/{height}";
|
||||
option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1
|
|||
for dir in $proto_dirs; do
|
||||
|
||||
# generate swagger files (filter query files)
|
||||
query_file=$(find "${dir}" -maxdepth 1 -name 'query.proto')
|
||||
query_file=$(find "${dir}" -maxdepth 1 \( -name 'query.proto' -o -name 'service.proto' \))
|
||||
if [[ ! -z "$query_file" ]]; then
|
||||
buf protoc \
|
||||
-I "proto" \
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
package keeper_test
|
||||
|
||||
|
||||
/// This file is a test driver for model-based tests generated from the TLA+ model of token transfer
|
||||
/// Written by Andrey Kuprianov within the scope of IBC Audit performed by Informal Systems.
|
||||
/// In case of any questions please don't hesitate to contact andrey@informal.systems.
|
||||
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
"github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types"
|
||||
|
@ -16,53 +20,48 @@ import (
|
|||
channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"
|
||||
"github.com/cosmos/cosmos-sdk/x/ibc/core/exported"
|
||||
ibctesting "github.com/cosmos/cosmos-sdk/x/ibc/testing"
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
"io/ioutil"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
||||
type TlaBalance struct {
|
||||
Address []string `json:"address"`
|
||||
Denom []string `json:"denom"`
|
||||
Amount int64 `json:"amount"`
|
||||
Address []string `json:"address"`
|
||||
Denom []string `json:"denom"`
|
||||
Amount int64 `json:"amount"`
|
||||
}
|
||||
|
||||
type TlaFungibleTokenPacketData struct {
|
||||
Sender string `json:"sender"`
|
||||
Sender string `json:"sender"`
|
||||
Receiver string `json:"receiver"`
|
||||
Amount int `json:"amount"`
|
||||
Denom []string `json:"denom"`
|
||||
Amount int `json:"amount"`
|
||||
Denom []string `json:"denom"`
|
||||
}
|
||||
|
||||
type TlaFungibleTokenPacket struct {
|
||||
SourceChannel string `json:"sourceChannel"`
|
||||
SourcePort string `json:"sourcePort"`
|
||||
DestChannel string `json:"destChannel"`
|
||||
DestPort string `json:"destPort"`
|
||||
Data TlaFungibleTokenPacketData `json:"data"`
|
||||
SourceChannel string `json:"sourceChannel"`
|
||||
SourcePort string `json:"sourcePort"`
|
||||
DestChannel string `json:"destChannel"`
|
||||
DestPort string `json:"destPort"`
|
||||
Data TlaFungibleTokenPacketData `json:"data"`
|
||||
}
|
||||
|
||||
type TlaOnRecvPacketTestCase = struct {
|
||||
// The required subset of bank balances
|
||||
BankBefore []TlaBalance `json:"bankBefore"`
|
||||
BankBefore []TlaBalance `json:"bankBefore"`
|
||||
// The packet to process
|
||||
Packet TlaFungibleTokenPacket `json:"packet"`
|
||||
Packet TlaFungibleTokenPacket `json:"packet"`
|
||||
// The handler to call
|
||||
Handler string `json:"handler"`
|
||||
Handler string `json:"handler"`
|
||||
// The expected changes in the bank
|
||||
BankAfter []TlaBalance `json:"bankAfter"`
|
||||
BankAfter []TlaBalance `json:"bankAfter"`
|
||||
// Whether OnRecvPacket should fail or not
|
||||
Error bool `json:"error"`
|
||||
Error bool `json:"error"`
|
||||
}
|
||||
|
||||
type FungibleTokenPacket struct {
|
||||
SourceChannel string
|
||||
SourcePort string
|
||||
DestChannel string
|
||||
DestPort string
|
||||
Data types.FungibleTokenPacketData
|
||||
SourcePort string
|
||||
DestChannel string
|
||||
DestPort string
|
||||
Data types.FungibleTokenPacketData
|
||||
}
|
||||
|
||||
type OnRecvPacketTestCase = struct {
|
||||
|
@ -81,17 +80,16 @@ type OnRecvPacketTestCase = struct {
|
|||
|
||||
type OwnedCoin struct {
|
||||
Address string
|
||||
Denom string
|
||||
Denom string
|
||||
}
|
||||
|
||||
type Balance struct {
|
||||
Id string
|
||||
Id string
|
||||
Address string
|
||||
Denom string
|
||||
Amount sdk.Int
|
||||
Denom string
|
||||
Amount sdk.Int
|
||||
}
|
||||
|
||||
|
||||
func AddressFromString(address string) string {
|
||||
return sdk.AccAddress(crypto.AddressHash([]byte(address))).String()
|
||||
}
|
||||
|
@ -104,7 +102,7 @@ func AddressFromTla(addr []string) string {
|
|||
if len(addr[0]) == 0 && len(addr[1]) == 0 {
|
||||
// simple address: id
|
||||
s = addr[2]
|
||||
} else if len(addr[2]) == 0 {
|
||||
} else if len(addr[2]) == 0 {
|
||||
// escrow address: ics20-1\x00port/channel
|
||||
s = fmt.Sprintf("%s\x00%s/%s", types.Version, addr[0], addr[1])
|
||||
} else {
|
||||
|
@ -115,7 +113,7 @@ func AddressFromTla(addr []string) string {
|
|||
|
||||
func DenomFromTla(denom []string) string {
|
||||
var i int
|
||||
for i = 0; i+1 < len(denom) && len(denom[i])==0 && len(denom[i+1])==0; i+=2 {
|
||||
for i = 0; i+1 < len(denom) && len(denom[i]) == 0 && len(denom[i+1]) == 0; i += 2 {
|
||||
// skip empty prefixes
|
||||
}
|
||||
return strings.Join(denom[i:], "/")
|
||||
|
@ -123,7 +121,7 @@ func DenomFromTla(denom []string) string {
|
|||
|
||||
func BalanceFromTla(balance TlaBalance) Balance {
|
||||
return Balance{
|
||||
Id: AddressFromTla(balance.Address),
|
||||
Id: AddressFromTla(balance.Address),
|
||||
Address: AddressFromString(AddressFromTla(balance.Address)),
|
||||
Denom: DenomFromTla(balance.Denom),
|
||||
Amount: sdk.NewInt(balance.Amount),
|
||||
|
@ -131,7 +129,7 @@ func BalanceFromTla(balance TlaBalance) Balance {
|
|||
}
|
||||
|
||||
func BalancesFromTla(tla []TlaBalance) []Balance {
|
||||
balances := make([]Balance,0)
|
||||
balances := make([]Balance, 0)
|
||||
for _, b := range tla {
|
||||
balances = append(balances, BalanceFromTla(b))
|
||||
}
|
||||
|
@ -144,7 +142,7 @@ func FungibleTokenPacketFromTla(packet TlaFungibleTokenPacket) FungibleTokenPack
|
|||
SourcePort: packet.SourcePort,
|
||||
DestChannel: packet.DestChannel,
|
||||
DestPort: packet.DestPort,
|
||||
Data: types.NewFungibleTokenPacketData(
|
||||
Data: types.NewFungibleTokenPacketData(
|
||||
DenomFromTla(packet.Data.Denom),
|
||||
uint64(packet.Data.Amount),
|
||||
AddressFromString(packet.Data.Sender),
|
||||
|
@ -157,23 +155,21 @@ func OnRecvPacketTestCaseFromTla(tc TlaOnRecvPacketTestCase) OnRecvPacketTestCas
|
|||
description: "auto-generated",
|
||||
bankBefore: BalancesFromTla(tc.BankBefore),
|
||||
packet: FungibleTokenPacketFromTla(tc.Packet),
|
||||
handler: tc.Handler,
|
||||
bankAfter: BalancesFromTla(tc.BankAfter), // TODO different semantics
|
||||
handler: tc.Handler,
|
||||
bankAfter: BalancesFromTla(tc.BankAfter), // TODO different semantics
|
||||
pass: !tc.Error,
|
||||
}
|
||||
}
|
||||
|
||||
var addressMap = make(map[string]string)
|
||||
|
||||
|
||||
|
||||
type Bank struct {
|
||||
balances map[OwnedCoin]sdk.Int
|
||||
}
|
||||
|
||||
// Make an empty bank
|
||||
func MakeBank() Bank {
|
||||
return Bank{ balances: make(map[OwnedCoin]sdk.Int) }
|
||||
return Bank{balances: make(map[OwnedCoin]sdk.Int)}
|
||||
}
|
||||
|
||||
// Subtract other bank from this bank
|
||||
|
@ -216,7 +212,7 @@ func NullCoin() OwnedCoin {
|
|||
}
|
||||
|
||||
// Set several balances at once
|
||||
func BankFromBalances(balances []Balance) Bank{
|
||||
func BankFromBalances(balances []Balance) Bank {
|
||||
bank := MakeBank()
|
||||
for _, balance := range balances {
|
||||
coin := OwnedCoin{balance.Address, balance.Denom}
|
||||
|
@ -228,16 +224,16 @@ func BankFromBalances(balances []Balance) Bank{
|
|||
return bank
|
||||
}
|
||||
|
||||
|
||||
// String representation of all bank balances
|
||||
func (bank *Bank) String() string {
|
||||
str := ""
|
||||
for coin, amount := range bank.balances {
|
||||
str += coin.Address;
|
||||
str += coin.Address
|
||||
if addressMap[coin.Address] != "" {
|
||||
str += "(" + addressMap[coin.Address] + ")"
|
||||
}
|
||||
str += " : " + coin.Denom + " = " + amount.String() + "\n" }
|
||||
str += " : " + coin.Denom + " = " + amount.String() + "\n"
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
|
@ -255,7 +251,7 @@ func (bank *Bank) NonZeroString() string {
|
|||
// Construct a bank out of the chain bank
|
||||
func BankOfChain(chain *ibctesting.TestChain) Bank {
|
||||
bank := MakeBank()
|
||||
chain.App.BankKeeper.IterateAllBalances(chain.GetContext(), func(address sdk.AccAddress, coin sdk.Coin) (stop bool){
|
||||
chain.App.BankKeeper.IterateAllBalances(chain.GetContext(), func(address sdk.AccAddress, coin sdk.Coin) (stop bool) {
|
||||
fullDenom := coin.Denom
|
||||
if strings.HasPrefix(coin.Denom, "ibc/") {
|
||||
fullDenom, _ = chain.App.TransferKeeper.DenomPathFromHash(chain.GetContext(), coin.Denom)
|
||||
|
@ -289,21 +285,20 @@ func (suite *KeeperTestSuite) CheckBankBalances(chain *ibctesting.TestChain, ban
|
|||
diff := bankChange.Sub(expectedBankChange)
|
||||
NonZeroString := diff.NonZeroString()
|
||||
if len(NonZeroString) != 0 {
|
||||
return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "Unexpected changes in the bank: \n" + NonZeroString)
|
||||
return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "Unexpected changes in the bank: \n"+NonZeroString)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
func (suite *KeeperTestSuite) TestModelBasedRelay() {
|
||||
dirname := "model_based_tests/"
|
||||
files,err := ioutil.ReadDir(dirname)
|
||||
files, err := ioutil.ReadDir(dirname)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("Failed to read model-based test files: %w", err))
|
||||
}
|
||||
for _, file_info := range files {
|
||||
var tlaTestCases = []TlaOnRecvPacketTestCase{}
|
||||
if ! strings.HasSuffix(file_info.Name(), ".json") {
|
||||
if !strings.HasSuffix(file_info.Name(), ".json") {
|
||||
continue
|
||||
}
|
||||
jsonBlob, err := ioutil.ReadFile(dirname + file_info.Name())
|
||||
|
@ -345,15 +340,15 @@ func (suite *KeeperTestSuite) TestModelBasedRelay() {
|
|||
}
|
||||
switch tc.handler {
|
||||
case "SendTransfer":
|
||||
var sender sdk.AccAddress;
|
||||
sender, err = sdk.AccAddressFromBech32(tc.packet.Data.Sender);
|
||||
var sender sdk.AccAddress
|
||||
sender, err = sdk.AccAddressFromBech32(tc.packet.Data.Sender)
|
||||
if err != nil {
|
||||
panic("MBT failed to convert sender address")
|
||||
}
|
||||
registerDenom();
|
||||
registerDenom()
|
||||
denomTrace := types.ParseDenomTrace(tc.packet.Data.Denom)
|
||||
denom := denomTrace.IBCDenom()
|
||||
err = sdk.ValidateDenom(denom);
|
||||
err = sdk.ValidateDenom(denom)
|
||||
if err == nil {
|
||||
err = suite.chainB.App.TransferKeeper.SendTransfer(
|
||||
suite.chainB.GetContext(),
|
||||
|
@ -368,14 +363,14 @@ func (suite *KeeperTestSuite) TestModelBasedRelay() {
|
|||
case "OnRecvPacket":
|
||||
err = suite.chainB.App.TransferKeeper.OnRecvPacket(suite.chainB.GetContext(), packet, tc.packet.Data)
|
||||
case "OnTimeoutPacket":
|
||||
registerDenom();
|
||||
registerDenom()
|
||||
err = suite.chainB.App.TransferKeeper.OnTimeoutPacket(suite.chainB.GetContext(), packet, tc.packet.Data)
|
||||
case "OnRecvAcknowledgementResult":
|
||||
err = suite.chainB.App.TransferKeeper.OnAcknowledgementPacket(
|
||||
suite.chainB.GetContext(), packet, tc.packet.Data,
|
||||
channeltypes.NewResultAcknowledgement(nil))
|
||||
case "OnRecvAcknowledgementError":
|
||||
registerDenom();
|
||||
registerDenom()
|
||||
err = suite.chainB.App.TransferKeeper.OnAcknowledgementPacket(
|
||||
suite.chainB.GetContext(), packet, tc.packet.Data,
|
||||
channeltypes.NewErrorAcknowledgement("MBT Error Acknowledgement"))
|
||||
|
|
Loading…
Reference in New Issue