Skip to content

Commit

Permalink
revert back to tabsg
Browse files Browse the repository at this point in the history
  • Loading branch information
thehowl committed Jan 23, 2025
1 parent 376a178 commit cceccde
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions gno.land/pkg/integration/testdata/issue_1786.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -43,41 +43,41 @@ module gno.land/r/demo/proxywugnot
package proxywugnot

import (
"std"
"std"

"gno.land/r/demo/wugnot"
"gno.land/r/demo/wugnot"
)

func ProxyWrap() {
sent := std.GetOrigSend()
ugnotSent := uint64(sent.AmountOf("ugnot"))
sent := std.GetOrigSend()
ugnotSent := uint64(sent.AmountOf("ugnot"))

if ugnotSent == 0 {
return
}
if ugnotSent == 0 {
return
}

// WRAP IT
wugnotAddr := std.DerivePkgAddr("gno.land/r/demo/wugnot")
banker := std.GetBanker(std.BankerTypeRealmSend)
banker.SendCoins(std.CurrentRealm().Addr(), wugnotAddr, std.Coins{{"ugnot", int64(ugnotSent)}})
wugnot.Deposit() // `proxywugnot` has ugnot
// WRAP IT
wugnotAddr := std.DerivePkgAddr("gno.land/r/demo/wugnot")
banker := std.GetBanker(std.BankerTypeRealmSend)
banker.SendCoins(std.CurrentRealm().Addr(), wugnotAddr, std.Coins{{"ugnot", int64(ugnotSent)}})
wugnot.Deposit() // `proxywugnot` has ugnot

// SEND WUGNOT: PROXY_WUGNOT -> USER
wugnot.Transfer(std.GetOrigCaller(), ugnotSent)
// SEND WUGNOT: PROXY_WUGNOT -> USER
wugnot.Transfer(std.GetOrigCaller(), ugnotSent)
}

func ProxyUnwrap(wugnotAmount uint64) {
if wugnotAmount == 0 {
return
}
if wugnotAmount == 0 {
return
}

// SEND WUGNOT: USER -> PROXY_WUGNOT
wugnot.TransferFrom(std.GetOrigCaller(), std.CurrentRealm().Addr(), wugnotAmount)
// SEND WUGNOT: USER -> PROXY_WUGNOT
wugnot.TransferFrom(std.GetOrigCaller(), std.CurrentRealm().Addr(), wugnotAmount)

// UNWRAP IT
wugnot.Withdraw(wugnotAmount)
// UNWRAP IT
wugnot.Withdraw(wugnotAmount)

// SEND GNOT: PROXY_WUGNOT -> USER
banker := std.GetBanker(std.BankerTypeRealmSend)
banker.SendCoins(std.CurrentRealm().Addr(), std.GetOrigCaller(), std.Coins{{"ugnot", int64(wugnotAmount)}})
}
// SEND GNOT: PROXY_WUGNOT -> USER
banker := std.GetBanker(std.BankerTypeRealmSend)
banker.SendCoins(std.CurrentRealm().Addr(), std.GetOrigCaller(), std.Coins{{"ugnot", int64(wugnotAmount)}})
}

0 comments on commit cceccde

Please sign in to comment.