-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix proto pkg gravity exports and tests
- Loading branch information
1 parent
ebdd12c
commit e36a7a6
Showing
2 changed files
with
50 additions
and
11 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 |
---|---|---|
@@ -1,20 +1,55 @@ | ||
import { createMsgBid } from './msgSendToEth' | ||
import { MsgBid } from '../../proto/auction/v1/msgs_pb' | ||
import { createMsgSendToEth } from './msgSendToEth' | ||
import { createMsgCancelSendToEth } from './msgCancelSendToEth' | ||
import { createMsgRequestBatch } from './msgRequestBatch' | ||
import { createMsgExecuteIbcAutoForwards } from './msgExecuteIbcAutoForwards' | ||
|
||
import { MsgSendToEth, MsgCancelSendToEth, MsgRequestBatch, MsgExecuteIbcAutoForwards } from '../../proto/gravity/v1/msgs_pb' | ||
import { from, to, denom } from '../../proto/tests/utils' | ||
import { JSONOptions } from '../../registry/registry' | ||
|
||
describe('test Auction Module message generation', () => { | ||
it('correctly wraps MsgBid', () => { | ||
const id = '1' | ||
describe('test Gravity Module message generation', () => { | ||
it('correctly wraps MsgSendToEth', () => { | ||
const amount = '10000000' | ||
const msg = createMsgSendToEth(from, to, amount, denom, amount, amount) | ||
|
||
expect(msg.message.toJson(JSONOptions)).toStrictEqual({ | ||
sender: from, | ||
eth_dest: to, | ||
amount, | ||
denom, | ||
bridge_fee: amount, | ||
chain_fee: amount, | ||
}) | ||
expect(msg.path).toStrictEqual(MsgSendToEth.typeName) | ||
}) | ||
|
||
it('correctly wraps MsgCancelSendToEth', () => { | ||
const msg = createMsgCancelSendToEth(from) | ||
|
||
expect(msg.message.toJson(JSONOptions)).toStrictEqual({ | ||
sender: from, | ||
}) | ||
expect(msg.path).toStrictEqual(MsgCancelSendToEth.typeName) | ||
}) | ||
|
||
it('correctly wraps MsgRequestBatch', () => { | ||
const msg = createMsgRequestBatch(from, denom) | ||
|
||
expect(msg.message.toJson(JSONOptions)).toStrictEqual({ | ||
sender: from, | ||
denom, | ||
}) | ||
expect(msg.path).toStrictEqual(MsgRequestBatch.typeName) | ||
}) | ||
|
||
it('correctly wraps MsgExecuteIbcAutoForwards', () => { | ||
const amount = '10000000' | ||
const msg = createMsgBid(id, from, amount, amount) | ||
const msg = createMsgExecuteIbcAutoForwards(from, amount) | ||
|
||
expect(msg.message.toJson(JSONOptions)).toStrictEqual({ | ||
auction_id: id, | ||
bidder: from, | ||
amount: amount, | ||
bid_fee: amount, | ||
sender: from, | ||
forwards_to_clear: amount, | ||
}) | ||
expect(msg.path).toStrictEqual(MsgBid.typeName) | ||
expect(msg.path).toStrictEqual(MsgExecuteIbcAutoForwards.typeName) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export * from './msgSendToEth' | ||
export * from './msgCancelSendToEth' | ||
export * from './msgRequestBatch' | ||
export * from './msgExecuteIbcAutoForwards' | ||
|
||
export * from './registry' | ||
export * from './aminoRegistry' |