From 00c94141bf9880247baf75a56ae42fedc93d468f Mon Sep 17 00:00:00 2001 From: n3wbie Date: Thu, 23 Nov 2023 16:33:01 +0900 Subject: [PATCH] GSW-562 chore: update test env --- Dockerfile | 3 +- _test/XX_phase_v1.mk | 194 ---------------------------- _test/{phase_v2.mk => live_test.mk} | 0 3 files changed, 1 insertion(+), 196 deletions(-) delete mode 100644 _test/XX_phase_v1.mk rename _test/{phase_v2.mk => live_test.mk} (100%) diff --git a/Dockerfile b/Dockerfile index 89b54c2bb..4dd4c53dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,5 +7,4 @@ ADD . . ENV GNOLAND_RPC_URL "localhost:26657" -CMD ["/bin/bash","-c","_test/init_test_accounts.sh && make -f _test/phase_v2.mk all"] -# CMD ["/bin/bash","-c","_test/init_test_accounts.sh && make -f _test/phase_v1.mk all"] +CMD ["/bin/bash","-c","_test/init_test_accounts.sh && make -f _test/live_test.mk all"] diff --git a/_test/XX_phase_v1.mk b/_test/XX_phase_v1.mk deleted file mode 100644 index b1113f626..000000000 --- a/_test/XX_phase_v1.mk +++ /dev/null @@ -1,194 +0,0 @@ -# Test Mnemonic -# source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast - -# Test Accounts -# gnokey add -recover=true test1 -# gnokey add -recover=true -index 10 gsa -# gnokey add -recover=true -index 11 lp01 -# gnokey add -recover=true -index 13 tr01 - -ADDR_GSA := g12l9splsyngcgefrwa52x5a7scc29e9v086m6p4 -ADDR_LP01 := g1jqpr8r5akez83kp7ers0sfjyv2kgx45qa9qygd -ADDR_TR01 := g1wgdjecn5lylgvujzyspfzvhjm6qn4z8xqyyxdn - -ADDR_POOL := g1ee305k8yk0pjz443xpwtqdyep522f9g5r7d63w -ADDR_POS := g1htpxzv2dkplvzg50nd8fswrneaxmdpwn459thx - -TX_EXPIRE := 9999999999 - -NOW := $(shell date +%s) - -MAKEFILE := $(shell realpath $(firstword $(MAKEFILE_LIST))) -GNOLAND_RPC_URL ?= localhost:26657 -CHAINID ?= dev -ROOT_DIR:=$(shell dirname $(MAKEFILE))/.. - -.PHONY: help -help: - @echo "Available make commands:" - @cat $(MAKEFILE) | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /' - -.PHONY: all -all: deploy faucet approve pool-setup position-mint pool-swap done - -.PHONY: before-swap -before-swap: deploy faucet approve pool-setup position-mint - -.PHONY: deploy -deploy: deploy-foo deploy-bar deploy-gnos deploy-gnft deploy-gov deploy-pool deploy-position - -.PHONY: faucet -faucet: faucet-lp01 faucet-tr01 - -.PHONY: approve -approve: approve-lp01 approve-tr01 - -.PHONY: pool-setup -pool-setup: pool-init pool-create - -.PHONY: position-mint -position-mint: mint-01 - -.PHONY: pool-swap-zero-to-one -pool-swap: set-protocol-fee swap-01-200000 collect-protocol-fee - -.PHONY: pool-swap-one-to-zero -pool-swap: swap-10-300000 collect-protocol-fee - -# Deploy Tokens -# [GRC20] FOO, BAR: Token Pair for Pool -# [GRC20] GNOS: Default Staking Reward -# [GRC20] OBL: External Staking Reward -# [GRC721] GNFT: LP Token -deploy-foo: - $(info ************ [FOO] deploy token0 ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/foo -pkgpath gno.land/r/foo -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-bar: - $(info ************ [BAR] deploy token1 ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/bar -pkgpath gno.land/r/bar -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-gnos: - $(info ************ [GNOS] deploy staking reward ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/gnos -pkgpath gno.land/r/gnos -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-gnft: - $(info ************ [GNFT] deploy lp token ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/_setup/gnft -pkgpath gno.land/r/gnft -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - - -# Deploy Contracts -deploy-gov: - $(info ************ [GOV] deploy governance ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/gov -pkgpath gno.land/r/gov -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-pool: - $(info ************ [POOL] deploy pool ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/pool -pkgpath gno.land/r/pool -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - -deploy-position: - $(info ************ [POSITION] deploy position ************) - @echo "" | gnokey maketx addpkg -pkgdir $(ROOT_DIR)/position -pkgpath gno.land/r/position -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - @echo - - -# Facuet Tokens -faucet-lp01: - $(info ************ [FAUCET] foo & bar to lp01 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/foo -func FaucetL -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/bar -func FaucetL -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo - -faucet-tr01: - $(info ************ [FAUCET] foo & bar to tr01 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/foo -func FaucetL -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" tr01 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/bar -func FaucetL -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" tr01 > /dev/null - @echo - - -# Approve Tokens -approve-lp01: - $(info ************ [APPROVE] foo & bar from lp01 to pool ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/foo -func Approve -args $(ADDR_POOL) -args 50000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/bar -func Approve -args $(ADDR_POOL) -args 50000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @echo - - -approve-tr01: - $(info ************ [APPROVE] foo & bar from tr01 to pool ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/bar -func Approve -args $(ADDR_POOL) -args 50000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" tr01 > /dev/null - @echo "" | gnokey maketx call -pkgpath gno.land/r/foo -func Approve -args $(ADDR_POOL) -args 50000000000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" tr01 > /dev/null - @echo - - -# Pool -pool-init: - $(info ************ [POOL] init pool ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func InitManual -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo - -pool-create: - $(info ************ [POOL] create pool ( foo & bar & 500 ) ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CreatePool -args foo -args bar -args 500 -args 130621891405341611593710811006 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @$(MAKE) -f $(MAKEFILE) print-all-balance - @echo - - -# Position -mint-01: - $(info ************ [POSITION] mint foo & bar // tick range 9000 ~ 11000 // by lp01 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/position -func Mint -args foo -args bar -args 500 -args 5000 -args 15000 -args 3000000 -args 3000000 -args 1 -args 1 -args $(TX_EXPIRE) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" lp01 > /dev/null - @$(MAKE) -f $(MAKEFILE) print-all-balance - @echo - -# Pool // Swap -set-protocol-fee: - $(info ************ [POOL] Set Protocol Fee ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func SetFeeProtocol -args 6 -args 8 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @echo - -swap-01-200000: - $(info ************ [POOL] swap 200000token0 > token1 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func Swap -args foo -args bar -args 500 -args $(ADDR_TR01) -args true -args 200000 -args 4295128740 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" tr01 > /dev/null - @$(MAKE) -f $(MAKEFILE) print-all-balance - @echo - -swap-10-300000: - $(info ************ [POOL] swap 300000token1 > token0 ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func Swap -args foo -args bar -args 500 -args $(ADDR_TR01) -args false -args 300000 -args 1461446703485210103287273052203988822378723970341 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" tr01 > /dev/null - @$(MAKE) -f $(MAKEFILE) print-all-balance - @echo - -collect-protocol-fee: - $(info ************ [POOL] Collect Protocol Fee ************) - @echo "" | gnokey maketx call -pkgpath gno.land/r/pool -func CollectProtocol -args foo -args bar -args 500 -args $(ADDR_GSA) -args 100000 -args 100000 -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" gsa > /dev/null - @$(MAKE) -f $(MAKEFILE) print-gsa-balance - @$(MAKE) -f $(MAKEFILE) print-all-balance - @echo - -done: - @echo "" | gnokey maketx send -send 1ugnot -to $(ADDR_POOL) -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 9000000 -memo "" test1 > /dev/null - -print-all-balance: - $(info > BALANCES) - @echo pool_token0: $(shell curl -s 'http://$(GNOLAND_RPC_URL)/abci_query?path=%22vm/qeval%22&data=%22gno.land/r/foo\nBalanceOf(\"$(ADDR_POOL)\")%22' | jq -r ".result.response.ResponseBase.Data" | base64 -d | awk -F'[ ()]' '{print $$2}') - @echo pool_token1: $(shell curl -s 'http://$(GNOLAND_RPC_URL)/abci_query?path=%22vm/qeval%22&data=%22gno.land/r/bar\nBalanceOf(\"$(ADDR_POOL)\")%22' | jq -r ".result.response.ResponseBase.Data" | base64 -d | awk -F'[ ()]' '{print $$2}') - @echo - @echo lp01_token0: $(shell curl -s 'http://$(GNOLAND_RPC_URL)/abci_query?path=%22vm/qeval%22&data=%22gno.land/r/foo\nBalanceOf(\"$(ADDR_LP01)\")%22' | jq -r ".result.response.ResponseBase.Data" | base64 -d | awk -F'[ ()]' '{print $$2}') - @echo lp01_token1: $(shell curl -s 'http://$(GNOLAND_RPC_URL)/abci_query?path=%22vm/qeval%22&data=%22gno.land/r/bar\nBalanceOf(\"$(ADDR_LP01)\")%22' | jq -r ".result.response.ResponseBase.Data" | base64 -d | awk -F'[ ()]' '{print $$2}') - @echo - @echo tr01_token0: $(shell curl -s 'http://$(GNOLAND_RPC_URL)/abci_query?path=%22vm/qeval%22&data=%22gno.land/r/foo\nBalanceOf(\"$(ADDR_TR01)\")%22' | jq -r ".result.response.ResponseBase.Data" | base64 -d | awk -F'[ ()]' '{print $$2}') - @echo tr01_token1: $(shell curl -s 'http://$(GNOLAND_RPC_URL)/abci_query?path=%22vm/qeval%22&data=%22gno.land/r/bar\nBalanceOf(\"$(ADDR_TR01)\")%22' | jq -r ".result.response.ResponseBase.Data" | base64 -d | awk -F'[ ()]' '{print $$2}') - @echo - -print-gsa-balance: - $(info ************ [BALANCE] Gnoswap Admin ************) - @echo Token0: $(shell curl -s 'http://$(GNOLAND_RPC_URL)/abci_query?path=%22vm/qeval%22&data=%22gno.land/r/foo\nBalanceOf(\"$(ADDR_GSA)\")%22' | jq -r ".result.response.ResponseBase.Data" | base64 -d | awk -F'[ ()]' '{print $$2}') - @echo Token1: $(shell curl -s 'http://$(GNOLAND_RPC_URL)/abci_query?path=%22vm/qeval%22&data=%22gno.land/r/bar\nBalanceOf(\"$(ADDR_GSA)\")%22' | jq -r ".result.response.ResponseBase.Data" | base64 -d | awk -F'[ ()]' '{print $$2}') - @echo \ No newline at end of file diff --git a/_test/phase_v2.mk b/_test/live_test.mk similarity index 100% rename from _test/phase_v2.mk rename to _test/live_test.mk