Skip to content

Commit

Permalink
update ICS-20 callbacks with changes from #629
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaSripal committed Jul 7, 2022
1 parent 4dc84a3 commit 663113e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions spec/app/ics-020-fungible-token-transfer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ function onChanOpenInit(
channelIdentifier: Identifier,
counterpartyPortIdentifier: Identifier,
counterpartyChannelIdentifier: Identifier,
version: string) {
version: string) => (version: string, err: Error) {
// only unordered channels allowed
abortTransactionUnless(order === UNORDERED)
// assert that version is "ics20-1"
abortTransactionUnless(version === "ics20-1")
// assert that version is "ics20-1" or empty
// if empty, we return the default transfer version to core IBC
// as the version for this channel
abortTransactionUnless(version === "ics20-1" || version === "")
// allocate an escrow address
channelEscrowAddresses[channelIdentifier] = newAddress()
return "ics20-1", nil
}
```

Expand All @@ -143,15 +146,16 @@ function onChanOpenTry(
channelIdentifier: Identifier,
counterpartyPortIdentifier: Identifier,
counterpartyChannelIdentifier: Identifier,
version: string,
counterpartyVersion: string) {
counterpartyVersion: string) => (version: string, err: Error) {
// only unordered channels allowed
abortTransactionUnless(order === UNORDERED)
// assert that version is "ics20-1"
abortTransactionUnless(version === "ics20-1")
abortTransactionUnless(counterpartyVersion === "ics20-1")
// allocate an escrow address
channelEscrowAddresses[channelIdentifier] = newAddress()
// return version that this chain will use given the
// counterparty version
return "ics20-1", nil
}
```

Expand Down

0 comments on commit 663113e

Please sign in to comment.