Skip to content

Commit

Permalink
Fix typos (cosmos#1098)
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetdev0 authored Apr 29, 2024
1 parent 38a42ec commit 8e347a9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions spec/app/ics-100-atomic-swap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function makeSwap(request: MakeSwapMsg, packet: channelTypes.Packet) {
// locks the sellToken to the escrow account
const err = bank.sendCoins(request.makerAddress, escrowAddr, request.sellToken.amount, request.sellToken.denom)
abortTransactionUnless(err === null)
// contructs the IBC data packet
// constructs the IBC data packet
const packet = {
type: SwapMessageType.TYPE_MSG_MAKE_SWAP,
data: protobuf.encode(request), // encode the request message to protobuf bytes
Expand Down Expand Up @@ -451,7 +451,7 @@ function onRecvPacket(packet channeltypes.Packet) {

switch swapPacket.type {
case TYPE_MSG_MAKE_SWAP:
const makeMsg = protobuf.decode(swapPaket.data)
const makeMsg = protobuf.decode(swapPacket.data)

// check if buyToken is a valid token on the taker chain, could be either native or ibc token
const supply = bank.getSupply(makeMsg.buyToken.denom)
Expand All @@ -470,7 +470,7 @@ function onRecvPacket(packet channeltypes.Packet) {
}
break;
case TYPE_MSG_TAKE_SWAP:
const takeMsg = protobuf.decode(swapPaket.data)
const takeMsg = protobuf.decode(swapPacket.data)
const order = privateStore.get(takeMsg.orderId)
abortTransactionUnless(order !== null)
abortTransactionUnless(order.status === Status.SYNC)
Expand All @@ -495,7 +495,7 @@ function onRecvPacket(packet channeltypes.Packet) {
privateStore.set(takeMsg.orderId, order)
break;
case TYPE_MSG_CANCEL_SWAP:
const cancelMsg = protobuf.decode(swapPaket.data)
const cancelMsg = protobuf.decode(swapPacket.data)
const order = privateStore.get(cancelMsg.orderId)
abortTransactionUnless(order !== null)
abortTransactionUnless(order.status === Status.SYNC || order.status == Status.INITIAL)
Expand Down Expand Up @@ -528,12 +528,12 @@ function onAcknowledgePacket(
refundTokens(packet)
} else {

const swapPaket: AtomicSwapPacketData = protobuf.decode(packet.data)
const swapPacket: AtomicSwapPacketData = protobuf.decode(packet.data)
const escrowAddr = escrowAddress(packet.sourcePort, packet.sourceChannel)

switch swapPaket.type {
switch swapPacket.type {
case TYPE_MSG_MAKE_SWAP:
const makeMsg = protobuf.decode(swapPaket.data)
const makeMsg = protobuf.decode(swapPacket.data)

// update order status on the maker chain.
const order = privateStore.get(generateOrderId(packet))
Expand All @@ -542,7 +542,7 @@ function onAcknowledgePacket(
privateStore.set(order.id, order)
break;
case TYPE_MSG_TAKE_SWAP:
const takeMsg = protobuf.decode(swapPaket.data)
const takeMsg = protobuf.decode(swapPacket.data)

// update order status on the taker chain.
const order = privateStore.get(takeMsg.orderId)
Expand All @@ -557,7 +557,7 @@ function onAcknowledgePacket(

break;
case TYPE_MSG_CANCEL_SWAP:
const cancelMsg = protobuf.decode(swapPaket.data)
const cancelMsg = protobuf.decode(swapPacket.data)

// update order status on the maker chain.
const order = privateStore.get( cancelMsg.orderId )
Expand Down Expand Up @@ -595,7 +595,7 @@ function refundTokens(packet: Packet) {
const escrowAddr = escrowAddress(packet.sourcePort, packet.sourceChannel)

// send tokens from module to message sender
switch swapPaket.type {
switch swapPacket.type {
case TYPE_MSG_MAKE_SWAP:
const msg = protobuf.decode(swapPacket.data)
bank.sendCoins(escrowAddr, msg.makerAddress, msg.sellToken.amount, msg.sellToken.denom)
Expand Down

0 comments on commit 8e347a9

Please sign in to comment.