Skip to content

Commit

Permalink
ICS20: fix port and add assertions for packet data (#1046)
Browse files Browse the repository at this point in the history
* ics20 nits

* fix assertion
  • Loading branch information
crodriguezvega authored Dec 18, 2023
1 parent 5161e2f commit 66c5256
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/app/ics-020-fungible-token-transfer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ The `setup` function must be called exactly once when the module is created (per

```typescript
function setup() {
capability = routingModule.bindPort("bank", ModuleCallbacks{
capability = routingModule.bindPort("transfer", ModuleCallbacks{
onChanOpenInit,
onChanOpenTry,
onChanOpenAck,
Expand Down Expand Up @@ -257,6 +257,11 @@ function sendFungibleTokens(
```typescript
function onRecvPacket(packet: Packet) {
FungibleTokenPacketData data = packet.data
assert(data.denom !== "")
assert(data.amount > 0)
assert(data.sender !== "")
assert(data.receiver !== "")

// construct default acknowledgement of success
FungibleTokenPacketAcknowledgement ack = FungibleTokenPacketAcknowledgement{true, null}
prefix = "{packet.sourcePort}/{packet.sourceChannel}/"
Expand Down

0 comments on commit 66c5256

Please sign in to comment.