@cosmology/ast
Version:
Cosmos TypeScript AST generation
102 lines (100 loc) • 4.73 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _utils = require("@cosmology/utils");
var _ast = require("@cosmology/ast");
var _testUtils = require("../../../test-utils");
var _object = require("../object");
var store = (0, _testUtils.getTestProtoStore)();
store.options.aminoEncoding.useRecursiveV2encoding = true;
store.options.interfaces.enabled = true;
store.traverseAll();
it('MsgSubmitProposal', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
var ref, context;
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
ref = store.findProto('cosmos/gov/v1beta1/tx.proto');
context = new _ast.ProtoParseContext(ref, store, store.options);
(0, _testUtils.expectCode)((0, _object.createObjectWithMethods)(context, 'MsgSubmitProposal', (0, _utils.getNestedProto)(ref.traversed).MsgSubmitProposal));
case 3:
case "end":
return _context.stop();
}
}, _callee);
})));
// MsgCreateValidator
it('MsgCreateValidator', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
var ref, context;
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
ref = store.findProto('cosmos/staking/v1beta1/tx.proto');
context = new _ast.ProtoParseContext(ref, store, store.options);
(0, _testUtils.expectCode)((0, _object.createObjectWithMethods)(context, 'MsgCreateValidator', (0, _utils.getNestedProto)(ref.traversed).MsgCreateValidator));
case 3:
case "end":
return _context2.stop();
}
}, _callee2);
})));
// Google
it('Duration', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
var ref, context;
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
ref = store.findProto('google/protobuf/duration.proto');
context = new _ast.ProtoParseContext(ref, store, store.options);
(0, _testUtils.expectCode)((0, _object.createObjectWithMethods)(context, 'Duration', (0, _utils.getNestedProto)(ref.traversed).Duration));
case 3:
case "end":
return _context3.stop();
}
}, _callee3);
})));
// Wasm
it('MsgStoreCode', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
var ref, context;
return _regenerator["default"].wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
ref = store.findProto('cosmwasm/wasm/v1/tx.proto');
context = new _ast.ProtoParseContext(ref, store, store.options);
(0, _testUtils.expectCode)((0, _object.createObjectWithMethods)(context, 'MsgStoreCode', (0, _utils.getNestedProto)(ref.traversed).MsgStoreCode));
case 3:
case "end":
return _context4.stop();
}
}, _callee4);
})));
// IBC
it('Height', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
var ref, context;
return _regenerator["default"].wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
ref = store.findProto('ibc/core/client/v1/client.proto');
context = new _ast.ProtoParseContext(ref, store, store.options);
(0, _testUtils.expectCode)((0, _object.createObjectWithMethods)(context, 'Height', (0, _utils.getNestedProto)(ref.traversed).Height));
case 3:
case "end":
return _context5.stop();
}
}, _callee5);
})));
it('MsgTransfer', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
var ref, context;
return _regenerator["default"].wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
ref = store.findProto('ibc/applications/transfer/v1/tx.proto');
context = new _ast.ProtoParseContext(ref, store, store.options);
(0, _testUtils.expectCode)((0, _object.createObjectWithMethods)(context, 'MsgTransfer', (0, _utils.getNestedProto)(ref.traversed).MsgTransfer));
case 3:
case "end":
return _context6.stop();
}
}, _callee6);
})));
;