Skip to content

Commit

Permalink
chore: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: moul <[email protected]>
  • Loading branch information
moul committed Jan 15, 2025
1 parent 7a45b94 commit 1c4ceaf
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions gno.land/pkg/integration/testdata/atomicswap.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ adduser test3

gnoland start

gnokey maketx send -send 1000000000ugnot -to $USER_ADDR_test2 -gas-fee 1000000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1
gnokey maketx send -send 1000000000ugnot -to $USER_ADDR_test3 -gas-fee 1000000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1
gnokey maketx send -send 1000000000ugnot -to $test2_user_addr -gas-fee 1000000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1
gnokey maketx send -send 1000000000ugnot -to $test3_user_addr -gas-fee 1000000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1

gnokey query auth/accounts/$USER_ADDR_test2
gnokey query auth/accounts/$test2_user_addr
stdout 'coins.*:.*1010000000ugnot'

gnokey query auth/accounts/$USER_ADDR_test3
gnokey query auth/accounts/$test3_user_addr
stdout 'coins.*:.*1010000000ugnot'

# To generate the hash for "secret", use a hashing tool or library of your choice. For example:
# In Unix-based systems, you can use:
# echo -n "secret" | sha256sum
# This will produce a hashlock string like "2bb808d537b1da3e38bd30361aa85586dbbeacdd7126fef6a25ef97b5f27a25b".
# Replace the hashlock argument in the command below with the generated hash.
gnokey maketx call -pkgpath gno.land/r/demo/atomicswap -func NewCoinSwap -gas-fee 1000000ugnot -send 12345ugnot -gas-wanted 10000000 -args $USER_ADDR_test3 -args '2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b' -broadcast -chainid=tendermint_test test2
gnokey maketx call -pkgpath gno.land/r/demo/atomicswap -func NewCoinSwap -gas-fee 1000000ugnot -send 12345ugnot -gas-wanted 10000000 -args $test3_user_addr -args '2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b' -broadcast -chainid=tendermint_test test2
stdout '(1 int)'
stdout ".*$USER_ADDR_test2.*$USER_ADDR_test3.*12345ugnot.*"
stdout ".*$test2_user_addr.*$test3_user_addr.*12345ugnot.*"
stdout 'OK!'

gnokey maketx call -pkgpath gno.land/r/demo/atomicswap -func Render -gas-fee 1000000ugnot -gas-wanted 10000000 -args '' -broadcast -chainid=tendermint_test test2
stdout 'OK!'

gnokey query auth/accounts/$USER_ADDR_test2
gnokey query auth/accounts/$test2_user_addr
stdout 'coins.*:.*1007987655ugnot'
gnokey query auth/accounts/$USER_ADDR_test3
gnokey query auth/accounts/$test3_user_addr
stdout 'coins.*:.*1010000000ugnot'

gnokey maketx call -pkgpath gno.land/r/demo/atomicswap -func Claim -gas-fee 1ugnot -gas-wanted 10000000 -args '1' -args 'secret' -broadcast -chainid=tendermint_test test3
stdout 'OK!'

gnokey query auth/accounts/$USER_ADDR_test2
gnokey query auth/accounts/$test2_user_addr
stdout 'coins.*:.*1007987655ugnot'
gnokey query auth/accounts/$USER_ADDR_test3
gnokey query auth/accounts/$test3_user_addr
stdout 'coins.*:.*1010012344ugnot'

0 comments on commit 1c4ceaf

Please sign in to comment.