Skip to content

Commit

Permalink
GSW-1793 main branch for test5 (#392)
Browse files Browse the repository at this point in the history
* GSW-1793 feat: service time

* GSW-1793 feat: change admin address
  • Loading branch information
r3v4s authored Nov 20, 2024
1 parent 2c8b7b6 commit fe756d2
Show file tree
Hide file tree
Showing 45 changed files with 128 additions and 162 deletions.
2 changes: 1 addition & 1 deletion __local/grc20_tokens/onbloc/bar/bar.gno
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
)

func init() {
admin = ownable.NewWithAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") // ADMIN
admin = ownable.NewWithAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") // ADMIN
banker = grc20.NewBanker("Bar", "BAR", 6)
banker.Mint(admin.Owner(), 100_000_000_000_000)
token = banker.Token()
Expand Down
2 changes: 1 addition & 1 deletion __local/grc20_tokens/onbloc/baz/baz.gno
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
)

func init() {
admin = ownable.NewWithAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") // ADMIN
admin = ownable.NewWithAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") // ADMIN
banker = grc20.NewBanker("Baz", "BAZ", 6)
banker.Mint(admin.Owner(), 100_000_000_000_000)
token = banker.Token()
Expand Down
2 changes: 1 addition & 1 deletion __local/grc20_tokens/onbloc/foo/foo.gno
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
)

func init() {
admin = ownable.NewWithAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") // ADMIN
admin = ownable.NewWithAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") // ADMIN
banker = grc20.NewBanker("Foo", "FOO", 6)
banker.Mint(admin.Owner(), 100_000_000_000_000)
token = banker.Token()
Expand Down
2 changes: 1 addition & 1 deletion __local/grc20_tokens/onbloc/obl/obl.gno
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
)

func init() {
admin = ownable.NewWithAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") // ADMIN
admin = ownable.NewWithAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") // ADMIN
banker = grc20.NewBanker("Obl", "OBL", 6)
banker.Mint(admin.Owner(), 100_000_000_000_000)
token = banker.Token()
Expand Down
2 changes: 1 addition & 1 deletion __local/grc20_tokens/onbloc/qux/qux.gno
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
)

func init() {
admin = ownable.NewWithAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") // ADMIN
admin = ownable.NewWithAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") // ADMIN
banker = grc20.NewBanker("Qux", "QUX", 6)
banker.Mint(admin.Owner(), 100_000_000_000_000)
token = banker.Token()
Expand Down
2 changes: 1 addition & 1 deletion __local/grc20_tokens/onbloc/usdc/usdc.gno
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var (
)

func init() {
admin = ownable.NewWithAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") // ADMIN
admin = ownable.NewWithAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") // ADMIN
banker = grc20.NewBanker("Usd Coin", "USDC", 6)
banker.Mint(admin.Owner(), 100_000_000_000_000)
token = banker.Token()
Expand Down
2 changes: 1 addition & 1 deletion __local/test/all_test_data.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# make -f __local/test/test_data.mk init init-test

ADDR_GSA := g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c
ADDR_GSA := g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d

ADDR_LP01 := g1qf5863trkaq447zr2xdmql83g0twzl37dm9qqt
ADDR_LP02 := g1ta0w7j4f586kwqu584z5h5sjurzywz3na7qg0a
Expand Down
2 changes: 1 addition & 1 deletion __local/test/emission_test.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# make -f __local/test/emission_test.mk init init-test

ADDR_GSA := g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c
ADDR_GSA := g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d
ADDR_REGISTER := g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5

ADDR_GOV := g1cu4dufdlzu0l9pekkqhw6mjnrxkp3z7ykst09d
Expand Down
4 changes: 2 additions & 2 deletions __local/test/gov_proposal.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# make -f __local/test/gov_proposal.mk init init-test gov-test

ADDR_GSA := g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c
ADDR_GSA := g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d
ADDR_REGISTER := g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5

ADDR_LP01 := g1qf5863trkaq447zr2xdmql83g0twzl37dm9qqt
Expand Down Expand Up @@ -357,7 +357,7 @@ execute-community:

propose-param:
$(info ************ propose param change // gnoswap_admin ************)
@echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v1/gov/governance -func ProposeParameterChange -args "title param change" -args "desc param change" -args "2" -args "gno.land/r/gnoswap/v1/gns*EXE*SetAvgBlockTimeInMs*EXE*123*GOV*gno.land/r/gnoswap/v1/community_pool*EXE*TransferToken*EXE*gno.land/r/gnoswap/v1/gns,g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c,905" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin
@echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v1/gov/governance -func ProposeParameterChange -args "title param change" -args "desc param change" -args "2" -args "gno.land/r/gnoswap/v1/gns*EXE*SetAvgBlockTimeInMs*EXE*123*GOV*gno.land/r/gnoswap/v1/community_pool*EXE*TransferToken*EXE*gno.land/r/gnoswap/v1/gns,g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d,905" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin
@echo

vote-param:
Expand Down
4 changes: 2 additions & 2 deletions __local/test/launchpad_test.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# make -f __local/test/launchpad.mk init init-test launchpad-test

ADDR_GSA := g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c
ADDR_GSA := g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d
ADDR_REGISTER := g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5

ADDR_LP01 := g1qf5863trkaq447zr2xdmql83g0twzl37dm9qqt
Expand Down Expand Up @@ -382,7 +382,7 @@ execute-community:

propose-param:
$(info ************ propose param change // gnoswap_admin ************)
@echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v1/gov/governance -func ProposeParameterChange -args "title param change" -args "desc param change" -args "2" -args "gno.land/r/gnoswap/v1/gns*EXE*SetAvgBlockTimeInMs*EXE*123*GOV*gno.land/r/gnoswap/v1/community_pool*EXE*TransferToken*EXE*gno.land/r/gnoswap/v1/gns,g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c,905" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin
@echo "" | gnokey maketx call -pkgpath gno.land/r/gnoswap/v1/gov/governance -func ProposeParameterChange -args "title param change" -args "desc param change" -args "2" -args "gno.land/r/gnoswap/v1/gns*EXE*SetAvgBlockTimeInMs*EXE*123*GOV*gno.land/r/gnoswap/v1/community_pool*EXE*TransferToken*EXE*gno.land/r/gnoswap/v1/gns,g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d,905" -insecure-password-stdin=true -remote $(GNOLAND_RPC_URL) -broadcast=true -chainid $(CHAINID) -gas-fee 1ugnot -gas-wanted 100000000 -memo "" gnoswap_admin
@echo

vote-param:
Expand Down
6 changes: 3 additions & 3 deletions _deploy/r/gnoswap/common/tests/halt_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestSetHaltByAdmin(t *testing.T) {
t.Run("with non-admin privilege, panics", func(t *testing.T) {
uassert.PanicsWithMessage(
t,
`[GNOSWAP-COMMON-001] caller has no permission || halt.gno__SetHaltByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can set halt, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`,
`[GNOSWAP-COMMON-001] caller has no permission || halt.gno__SetHaltByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can set halt, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`,
func() { SetHaltByAdmin(false) },
)
})
Expand All @@ -37,7 +37,7 @@ func TestSetHaltByAdmin(t *testing.T) {
std.TestSetRealm(govRealm)
uassert.PanicsWithMessage(
t,
`[GNOSWAP-COMMON-001] caller has no permission || halt.gno__SetHaltByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can set halt, called from g17s8w2ve7k85fwfnrk59lmlhthkjdted8whvqxd`,
`[GNOSWAP-COMMON-001] caller has no permission || halt.gno__SetHaltByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can set halt, called from g17s8w2ve7k85fwfnrk59lmlhthkjdted8whvqxd`,
func() { SetHaltByAdmin(false) },
)
})
Expand Down Expand Up @@ -65,7 +65,7 @@ func TestSetHalt(t *testing.T) {
std.TestSetRealm(adminRealm)
uassert.PanicsWithMessage(
t,
`[GNOSWAP-COMMON-001] caller has no permission || halt.gno__SetHalt() || only governance(g17s8w2ve7k85fwfnrk59lmlhthkjdted8whvqxd) can set halt, called from g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c`,
`[GNOSWAP-COMMON-001] caller has no permission || halt.gno__SetHalt() || only governance(g17s8w2ve7k85fwfnrk59lmlhthkjdted8whvqxd) can set halt, called from g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d`,
func() { SetHalt(false) },
)
})
Expand Down
2 changes: 1 addition & 1 deletion _deploy/r/gnoswap/common/tests/limit_caller_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestSetLimitCaller(t *testing.T) {

t.Run("with non-admin privilege, panics", func(t *testing.T) {
uassert.PanicsWithMessage(t,
`[GNOSWAP-COMMON-001] caller has no permission || limit_caller.gno__SetLimitCaller() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can set limit caller, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`,
`[GNOSWAP-COMMON-001] caller has no permission || limit_caller.gno__SetLimitCaller() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can set limit caller, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`,
func() { SetLimitCaller(false) },
)
})
Expand Down
2 changes: 1 addition & 1 deletion _deploy/r/gnoswap/consts/consts.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

// GNOSWAP SERVICE
const (
ADMIN std.Address = "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c" // Admin
ADMIN std.Address = "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d" // Admin
DEV_OPS std.Address = "g1mjvd83nnjee3z2g7683er55me9f09688pd4mj9" // DevOps

TOKEN_REGISTER std.Address = "g1er355fkjksqpdtwmhf5penwa82p0rhqxkkyhk5"
Expand Down
2 changes: 1 addition & 1 deletion _deploy/r/gnoswap/gns/gns.gno
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
)

func init() {
admin = ownable.NewWithAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") // ADMIN
admin = ownable.NewWithAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") // ADMIN
banker = grc20.NewBanker("Gnoswap", "GNS", 6)

banker.Mint(admin.Owner(), 100_000_000_000_000) // 100_000_000 GNS ≈ 0.1B
Expand Down
2 changes: 1 addition & 1 deletion _deploy/r/gnoswap/gns/tests/halving_test.gnoA
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func TestGetAmountByHeight(t *testing.T) {
func TestSetAvgBlockTimeInMsByAdmin(t *testing.T) {
t.Run("panic if not admin", func(t *testing.T) {
uassert.PanicsWithMessage(t,
`[GNOSWAP-GNS-001] caller has no permission || gns.gno__SetAvgBlockTimeInMsByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can call this function, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`,
`[GNOSWAP-GNS-001] caller has no permission || gns.gno__SetAvgBlockTimeInMsByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can call this function, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`,
func() {
SetAvgBlockTimeInMsByAdmin(1000)
})
Expand Down
2 changes: 1 addition & 1 deletion community_pool/tests/community_pool_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestTransferTokenByAdmin(t *testing.T) {
t.Run("panic if not admin", func(t *testing.T) {
uassert.PanicsWithMessage(
t,
"[GNOSWAP-COMMUNITY_POOL-001] caller has no permission || community_pool.gno__TransferTokenByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can transfer token, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm",
"[GNOSWAP-COMMUNITY_POOL-001] caller has no permission || community_pool.gno__TransferTokenByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can transfer token, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm",
func() {
TransferTokenByAdmin(consts.GNS_PATH, dummyAddr, 1000)
},
Expand Down
2 changes: 1 addition & 1 deletion emission/tests/distribution_test.gnoA
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestChangeDistributionPctByAdmin(t *testing.T) {
t.Run("panic if not admin", func(t *testing.T) {
uassert.PanicsWithMessage(
t,
`[GNOSWAP-EMISSION-001] caller has no permission || emission.gno__ChangeDistributionPctByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can change distribution percentages, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`,
`[GNOSWAP-EMISSION-001] caller has no permission || emission.gno__ChangeDistributionPctByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can change distribution percentages, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`,
func() {
ChangeDistributionPctByAdmin(0, 0, 0, 0, 0, 0, 0, 0)
},
Expand Down
22 changes: 5 additions & 17 deletions gov/governance/config.gno
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,14 @@ var (

func init() {
// https: //docs.gnoswap.io/core-concepts/governance
// ORIG TIME
// config = Config{
// VotingStartDelay: uint64(86400), // 1d
// VotingPeriod: uint64(604800), // 7d
// VotingWeightSmoothingDuration: uint64(86400), // 1d
// Quorum: uint64(50), // 50% of total xGNS supply
// ProposalCreationThreshold: uint64(1_000_000_000), // 1_000_000_000
// ExecutionDelay: uint64(86400), // 1d
// ExecutionWindow: uint64(2592000), // 30d
// }

// QA TIME
config = Config{
VotingStartDelay: uint64(180), // 3m
VotingPeriod: uint64(600), // 10m
VotingWeightSmoothingDuration: uint64(600), // 10m
VotingStartDelay: uint64(86400), // 1d
VotingPeriod: uint64(604800), // 7d
VotingWeightSmoothingDuration: uint64(86400), // 1d
Quorum: uint64(50), // 50% of total xGNS supply
ProposalCreationThreshold: uint64(1_000_000_000), // 1_000_000_000
ExecutionDelay: uint64(60), // 1m
ExecutionWindow: uint64(3600), // 1h
ExecutionDelay: uint64(86400), // 1d
ExecutionWindow: uint64(2592000), // 30d
}

// config version 0 should return the current config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ func TestProposeParameterChange_Two_SetAvgBlockTimeInMs_CommunityPoolSpend(t *te
"test_title",
"test_description",
uint64(2),
"gno.land/r/gnoswap/v1/gns*EXE*SetAvgBlockTimeInMs*EXE*123*GOV*gno.land/r/gnoswap/v1/community_pool*EXE*TransferToken*EXE*gno.land/r/gnoswap/v1/gns,g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c,905",
"gno.land/r/gnoswap/v1/gns*EXE*SetAvgBlockTimeInMs*EXE*123*GOV*gno.land/r/gnoswap/v1/community_pool*EXE*TransferToken*EXE*gno.land/r/gnoswap/v1/gns,g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d,905",
)

uassert.Equal(t, proposalID, uint64(1))

proposalJson := GetProposalById(1)
uassert.Equal(t, proposalJson, `{"height":"128","now":"1234567900","proposals":[{"id":"1","configVersion":"1","proposer":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTAwIiwiVXBjb21pbmciOiJ0cnVlIiwiQWN0aXZlIjoiZmFsc2UiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MTAiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTQwIiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"PARAMETER_CHANGE","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiI1MDAwMDAiLCJtYXgiOiIxMDAwMDAwIiwieWVzIjoiMCIsIm5vIjoiMCJ9","extra":"Z25vLmxhbmQvci9nbm9zd2FwL3YyL2ducypFWEUqU2V0QXZnQmxvY2tUaW1lSW5NcypFWEUqMTIzKkdPVipnbm8ubGFuZC9yL2dub3N3YXAvdjIvY29tbXVuaXR5X3Bvb2wqRVhFKlRyYW5zZmVyVG9rZW4qRVhFKmduby5sYW5kL3IvZ25vc3dhcC92Mi9nbnMsZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yyw5MDU="}]}`)
uassert.Equal(t, proposalJson, `{"height":"128","now":"1234567900","proposals":[{"id":"1","configVersion":"1","proposer":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTAwIiwiVXBjb21pbmciOiJ0cnVlIiwiQWN0aXZlIjoiZmFsc2UiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MTAiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTQwIiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"PARAMETER_CHANGE","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiI1MDAwMDAiLCJtYXgiOiIxMDAwMDAwIiwieWVzIjoiMCIsIm5vIjoiMCJ9","extra":"Z25vLmxhbmQvci9nbm9zd2FwL3YyL2ducypFWEUqU2V0QXZnQmxvY2tUaW1lSW5NcypFWEUqMTIzKkdPVipnbm8ubGFuZC9yL2dub3N3YXAvdjIvY29tbXVuaXR5X3Bvb2wqRVhFKlRyYW5zZmVyVG9rZW4qRVhFKmduby5sYW5kL3IvZ25vc3dhcC92Mi9nbnMsZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yyw5MDU="}]}`)

uassert.Equal(t, gns.BalanceOf(a2u(consts.COMMUNITY_POOL_ADDR)), uint64(3567351)) // community pool receives 5% of emission reward
uassert.Equal(t, std.GetHeight(), int64(128))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func passAndExecute(t *testing.T) {
updateProposalsState()

proposalsJson := GetProposals()
uassert.Equal(t, `{"height":"245","now":"1234568134","proposals":[{"id":"1","configVersion":"1","proposer":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTEyIiwiVXBjb21pbmciOiJmYWxzZSIsIkFjdGl2ZSI6ImZhbHNlIiwiVm90aW5nU3RhcnQiOiIxMjM0NTY3OTIyIiwiVm90aW5nRW5kIjoiMTIzNDU2Nzk1MiIsIlBhc3NlZCI6InRydWUiLCJQYXNzZWRBdCI6IjEyMzQ1NjgxMzQiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"COMMUNITY_POOL_SPEND","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiI1MDAwMDAiLCJtYXgiOiIxMDAwMDAwIiwieWVzIjoiMTAwMDAwMCIsIm5vIjoiMCJ9","extra":"eyJ0byI6ImcxdzNoNDdoNmx0YTA0N2g2bHRhMDQ3aDZsdGEwNDdoNmxma250cDciLCJ0b2tlblBhdGgiOiJnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zIiwiYW1vdW50IjoiMTAwIn0="}]}`, proposalsJson)
uassert.Equal(t, `{"height":"245","now":"1234568134","proposals":[{"id":"1","configVersion":"1","proposer":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTEyIiwiVXBjb21pbmciOiJmYWxzZSIsIkFjdGl2ZSI6ImZhbHNlIiwiVm90aW5nU3RhcnQiOiIxMjM0NTY3OTIyIiwiVm90aW5nRW5kIjoiMTIzNDU2Nzk1MiIsIlBhc3NlZCI6InRydWUiLCJQYXNzZWRBdCI6IjEyMzQ1NjgxMzQiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"COMMUNITY_POOL_SPEND","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiI1MDAwMDAiLCJtYXgiOiIxMDAwMDAwIiwieWVzIjoiMTAwMDAwMCIsIm5vIjoiMCJ9","extra":"eyJ0byI6ImcxdzNoNDdoNmx0YTA0N2g2bHRhMDQ3aDZsdGEwNDdoNmxma250cDciLCJ0b2tlblBhdGgiOiJnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zIiwiYW1vdW50IjoiMTAwIn0="}]}`, proposalsJson)

proposal := proposals[proposalId]
uassert.True(t, proposal.ExecutionState.Passed)
Expand Down
Loading

0 comments on commit fe756d2

Please sign in to comment.