diff --git a/__local/grc20_tokens/onbloc/bar/bar.gno b/__local/grc20_tokens/onbloc/bar/bar.gno index b65eedc2d..77cecdb5a 100644 --- a/__local/grc20_tokens/onbloc/bar/bar.gno +++ b/__local/grc20_tokens/onbloc/bar/bar.gno @@ -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() diff --git a/__local/grc20_tokens/onbloc/baz/baz.gno b/__local/grc20_tokens/onbloc/baz/baz.gno index 0e903ed51..887202da0 100644 --- a/__local/grc20_tokens/onbloc/baz/baz.gno +++ b/__local/grc20_tokens/onbloc/baz/baz.gno @@ -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() diff --git a/__local/grc20_tokens/onbloc/foo/foo.gno b/__local/grc20_tokens/onbloc/foo/foo.gno index 9ca631863..24d420357 100644 --- a/__local/grc20_tokens/onbloc/foo/foo.gno +++ b/__local/grc20_tokens/onbloc/foo/foo.gno @@ -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() diff --git a/__local/grc20_tokens/onbloc/obl/obl.gno b/__local/grc20_tokens/onbloc/obl/obl.gno index ff09d80b5..910949adb 100644 --- a/__local/grc20_tokens/onbloc/obl/obl.gno +++ b/__local/grc20_tokens/onbloc/obl/obl.gno @@ -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() diff --git a/__local/grc20_tokens/onbloc/qux/qux.gno b/__local/grc20_tokens/onbloc/qux/qux.gno index 830f55d5f..20a04ae0c 100644 --- a/__local/grc20_tokens/onbloc/qux/qux.gno +++ b/__local/grc20_tokens/onbloc/qux/qux.gno @@ -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() diff --git a/__local/grc20_tokens/onbloc/usdc/usdc.gno b/__local/grc20_tokens/onbloc/usdc/usdc.gno index 97d81cba0..236904d3d 100644 --- a/__local/grc20_tokens/onbloc/usdc/usdc.gno +++ b/__local/grc20_tokens/onbloc/usdc/usdc.gno @@ -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() diff --git a/__local/test/all_test_data.mk b/__local/test/all_test_data.mk index 6372f2e12..5090b81e4 100644 --- a/__local/test/all_test_data.mk +++ b/__local/test/all_test_data.mk @@ -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 diff --git a/__local/test/emission_test.mk b/__local/test/emission_test.mk index d1986dc77..d2075fea3 100644 --- a/__local/test/emission_test.mk +++ b/__local/test/emission_test.mk @@ -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 diff --git a/__local/test/gov_proposal.mk b/__local/test/gov_proposal.mk index 1f1381f56..7575ca9ce 100644 --- a/__local/test/gov_proposal.mk +++ b/__local/test/gov_proposal.mk @@ -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 @@ -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: diff --git a/__local/test/launchpad_test.mk b/__local/test/launchpad_test.mk index 9a035a54f..a0fdef7be 100644 --- a/__local/test/launchpad_test.mk +++ b/__local/test/launchpad_test.mk @@ -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 @@ -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: diff --git a/_deploy/r/gnoswap/common/tests/halt_test.gno b/_deploy/r/gnoswap/common/tests/halt_test.gno index d1f3c25ca..77ba962f9 100644 --- a/_deploy/r/gnoswap/common/tests/halt_test.gno +++ b/_deploy/r/gnoswap/common/tests/halt_test.gno @@ -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) }, ) }) @@ -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) }, ) }) @@ -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) }, ) }) diff --git a/_deploy/r/gnoswap/common/tests/limit_caller_test.gno b/_deploy/r/gnoswap/common/tests/limit_caller_test.gno index dc2c21590..7b98961ab 100644 --- a/_deploy/r/gnoswap/common/tests/limit_caller_test.gno +++ b/_deploy/r/gnoswap/common/tests/limit_caller_test.gno @@ -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) }, ) }) diff --git a/_deploy/r/gnoswap/consts/consts.gno b/_deploy/r/gnoswap/consts/consts.gno index 91ccd1e70..10e47e85d 100644 --- a/_deploy/r/gnoswap/consts/consts.gno +++ b/_deploy/r/gnoswap/consts/consts.gno @@ -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" diff --git a/_deploy/r/gnoswap/gns/gns.gno b/_deploy/r/gnoswap/gns/gns.gno index 4b5c79243..35d719e17 100644 --- a/_deploy/r/gnoswap/gns/gns.gno +++ b/_deploy/r/gnoswap/gns/gns.gno @@ -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 diff --git a/_deploy/r/gnoswap/gns/tests/halving_test.gnoA b/_deploy/r/gnoswap/gns/tests/halving_test.gnoA index d09e819bd..57b6d5eef 100644 --- a/_deploy/r/gnoswap/gns/tests/halving_test.gnoA +++ b/_deploy/r/gnoswap/gns/tests/halving_test.gnoA @@ -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) }) diff --git a/community_pool/tests/community_pool_test.gno b/community_pool/tests/community_pool_test.gno index a79eedb43..033f242c0 100644 --- a/community_pool/tests/community_pool_test.gno +++ b/community_pool/tests/community_pool_test.gno @@ -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) }, diff --git a/emission/tests/distribution_test.gnoA b/emission/tests/distribution_test.gnoA index a433eccd1..fd334eab9 100644 --- a/emission/tests/distribution_test.gnoA +++ b/emission/tests/distribution_test.gnoA @@ -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) }, diff --git a/gov/governance/config.gno b/gov/governance/config.gno index ecfb4f0cc..695c79379 100644 --- a/gov/governance/config.gno +++ b/gov/governance/config.gno @@ -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 diff --git a/gov/governance/tests/__TEST_governance_proposal_MULTI_execute_test.gnoA b/gov/governance/tests/__TEST_governance_proposal_MULTI_execute_test.gnoA index a2391593a..cda5f9005 100644 --- a/gov/governance/tests/__TEST_governance_proposal_MULTI_execute_test.gnoA +++ b/gov/governance/tests/__TEST_governance_proposal_MULTI_execute_test.gnoA @@ -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)) diff --git a/gov/governance/tests/__TEST_governance_proposal_community_pool_spend_test.gnoA b/gov/governance/tests/__TEST_governance_proposal_community_pool_spend_test.gnoA index ef9753b65..bbb4f78c1 100644 --- a/gov/governance/tests/__TEST_governance_proposal_community_pool_spend_test.gnoA +++ b/gov/governance/tests/__TEST_governance_proposal_community_pool_spend_test.gnoA @@ -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) diff --git a/gov/governance/tests/__TEST_governance_proposal_text_test.gnoA b/gov/governance/tests/__TEST_governance_proposal_text_test.gnoA index cd3432a78..ce08e8da8 100644 --- a/gov/governance/tests/__TEST_governance_proposal_text_test.gnoA +++ b/gov/governance/tests/__TEST_governance_proposal_text_test.gnoA @@ -37,7 +37,7 @@ func proposeText(t *testing.T) { t.Run("ProposeText with insufficient delegation", func(t *testing.T) { std.TestSetRealm(adminRealm) uassert.PanicsWithMessage(t, - "[GNOSWAP-GOVERNANCE-005] not enough balance || governance.gno__ProposeText() || proposer(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) has not enough xGNS, balance(0), wanted(100)", + "[GNOSWAP-GOVERNANCE-005] not enough balance || governance.gno__ProposeText() || proposer(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) has not enough xGNS, balance(0), wanted(100)", func() { ProposeText("title", "text") }) @@ -69,7 +69,7 @@ func proposeText(t *testing.T) { uassert.Equal(t, proposal.Description, "test_description") proposalsJson = GetProposals() - uassert.Equal(t, proposalsJson, `{"height":"134","now":"1234567912","proposals":[{"id":"1","configVersion":"1","proposer":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTEyIiwiVXBjb21pbmciOiJ0cnVlIiwiQWN0aXZlIjoiZmFsc2UiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MjIiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTUyIiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"TEXT","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiI1MDAwMDAiLCJtYXgiOiIxMDAwMDAwIiwieWVzIjoiMCIsIm5vIjoiMCJ9","extra":""}]}`) + uassert.Equal(t, proposalsJson, `{"height":"134","now":"1234567912","proposals":[{"id":"1","configVersion":"1","proposer":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTEyIiwiVXBjb21pbmciOiJ0cnVlIiwiQWN0aXZlIjoiZmFsc2UiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MjIiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTUyIiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"TEXT","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiI1MDAwMDAiLCJtYXgiOiIxMDAwMDAwIiwieWVzIjoiMCIsIm5vIjoiMCJ9","extra":""}]}`) votesJson := GetVotesByAddress(admin) uassert.Equal(t, votesJson, ``) @@ -114,7 +114,7 @@ func vote(t *testing.T) { uassert.True(t, proposal.ExecutionState.Active) proposalsJson := GetProposals() - uassert.Equal(t, proposalsJson, `{"height":"139","now":"1234567922","proposals":[{"id":"1","configVersion":"1","proposer":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTEyIiwiVXBjb21pbmciOiJmYWxzZSIsIkFjdGl2ZSI6InRydWUiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MjIiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTUyIiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"TEXT","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiI1MDAwMDAiLCJtYXgiOiIxMDAwMDAwIiwieWVzIjoiMTAwMDAwMCIsIm5vIjoiMCJ9","extra":""}]}`) + uassert.Equal(t, proposalsJson, `{"height":"139","now":"1234567922","proposals":[{"id":"1","configVersion":"1","proposer":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTEyIiwiVXBjb21pbmciOiJmYWxzZSIsIkFjdGl2ZSI6InRydWUiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MjIiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTUyIiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"TEXT","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiI1MDAwMDAiLCJtYXgiOiIxMDAwMDAwIiwieWVzIjoiMTAwMDAwMCIsIm5vIjoiMCJ9","extra":""}]}`) votesJson := GetVotesByAddress(admin) uassert.Equal(t, votesJson, `{"height":"139","now":"1234567922","votes":[{"proposalId":"1","voteYes":"true","voteWeight":"1000000","voteHeight":"139","voteTimestamp":"1234567922"}]}`) @@ -126,7 +126,7 @@ func vote(t *testing.T) { t.Run("Vote twice", func(t *testing.T) { std.TestSetRealm(adminRealm) uassert.PanicsWithMessage(t, - "[GNOSWAP-GOVERNANCE-009] can not vote twice || vote.gno__Vote() || user(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) has already voted on proposalId(1)", + "[GNOSWAP-GOVERNANCE-009] can not vote twice || vote.gno__Vote() || user(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) has already voted on proposalId(1)", func() { Vote(proposalId, true) }) diff --git a/gov/governance/tests/__TEST_governance_vote_gov_delegated_test.gnoA b/gov/governance/tests/__TEST_governance_vote_gov_delegated_test.gnoA index afd35e5f5..393ce61bf 100644 --- a/gov/governance/tests/__TEST_governance_vote_gov_delegated_test.gnoA +++ b/gov/governance/tests/__TEST_governance_vote_gov_delegated_test.gnoA @@ -38,7 +38,7 @@ func proposeText(t *testing.T) { t.Run("ProposeText with insufficient delegation", func(t *testing.T) { std.TestSetRealm(adminRealm) uassert.PanicsWithMessage(t, - "[GNOSWAP-GOVERNANCE-005] not enough balance || governance.gno__ProposeText() || proposer(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) has not enough xGNS, balance(0), wanted(100)", + "[GNOSWAP-GOVERNANCE-005] not enough balance || governance.gno__ProposeText() || proposer(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) has not enough xGNS, balance(0), wanted(100)", func() { ProposeText("title", "text") }) @@ -166,6 +166,6 @@ func vote(t *testing.T) { uassert.Equal(t, true, proposal.ExecutionState.Active) proposalsJson := GetProposals() - uassert.Equal(t, proposalsJson, `{"height":"141","now":"1234567926","proposals":[{"id":"1","configVersion":"1","proposer":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3ODk0IiwiVXBjb21pbmciOiJmYWxzZSIsIkFjdGl2ZSI6InRydWUiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MDQiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTM0IiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"TEXT","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiIxNTAwMDAwIiwibWF4IjoiMCIsInllcyI6IjAiLCJubyI6IjAifQ==","extra":""},{"id":"2","configVersion":"1","proposer":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTA0IiwiVXBjb21pbmciOiJmYWxzZSIsIkFjdGl2ZSI6InRydWUiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MTQiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTQ0IiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"TEXT","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiIxNTAwMDAwIiwibWF4IjoiMzAwMDAwMCIsInllcyI6IjIwMDAwMDAiLCJubyI6IjAifQ==","extra":""}]}`) + uassert.Equal(t, proposalsJson, `{"height":"141","now":"1234567926","proposals":[{"id":"1","configVersion":"1","proposer":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3ODk0IiwiVXBjb21pbmciOiJmYWxzZSIsIkFjdGl2ZSI6InRydWUiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MDQiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTM0IiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"TEXT","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiIxNTAwMDAwIiwibWF4IjoiMCIsInllcyI6IjAiLCJubyI6IjAifQ==","extra":""},{"id":"2","configVersion":"1","proposer":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","status":"eyJDcmVhdGVkQXQiOiIxMjM0NTY3OTA0IiwiVXBjb21pbmciOiJmYWxzZSIsIkFjdGl2ZSI6InRydWUiLCJWb3RpbmdTdGFydCI6IjEyMzQ1Njc5MTQiLCJWb3RpbmdFbmQiOiIxMjM0NTY3OTQ0IiwiUGFzc2VkIjoiZmFsc2UiLCJQYXNzZWRBdCI6IjAiLCJSZWplY3RlZCI6ImZhbHNlIiwiUmVqZWN0ZWRBdCI6IjAiLCJDYW5jZWxlZCI6ImZhbHNlIiwiQ2FuY2VsZWRBdCI6IjAiLCJFeGVjdXRlZCI6ImZhbHNlIiwiRXhlY3V0ZWRBdCI6IjAiLCJFeHBpcmVkIjoiZmFsc2UiLCJFeHBpcmVkQXQiOiIwIn0=","type":"TEXT","title":"test_title","description":"test_description","vote":"eyJxdW9ydW0iOiIxNTAwMDAwIiwibWF4IjoiMzAwMDAwMCIsInllcyI6IjIwMDAwMDAiLCJubyI6IjAifQ==","extra":""}]}`) }) } diff --git a/gov/governance/tests/config_test.gnoA b/gov/governance/tests/config_test.gnoA index ee003a1c1..9a6c4aa0d 100644 --- a/gov/governance/tests/config_test.gnoA +++ b/gov/governance/tests/config_test.gnoA @@ -12,7 +12,7 @@ import ( func TestReconfigureByAdmin(t *testing.T) { t.Run("panic if not admin", func(t *testing.T) { uassert.PanicsWithMessage(t, - `[GNOSWAP-GOVERNANCE-001] caller has no permission || config.gno__ReconfigureByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can call this function, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`, + `[GNOSWAP-GOVERNANCE-001] caller has no permission || config.gno__ReconfigureByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can call this function, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`, func() { ReconfigureByAdmin(200, 2000, 200, 1000, 200, 200, 2000) }) diff --git a/gov/staker/staker.gno b/gov/staker/staker.gno index d890fd096..4c2e8c1d5 100644 --- a/gov/staker/staker.gno +++ b/gov/staker/staker.gno @@ -23,10 +23,7 @@ type lockedGNS struct { unlock uint64 } -// ORIG TIME // const TIMESTAMP_7_DAYS = uint64(604800) // 7 days in seconds -// QA TIME -const TIMESTAMP_7_DAYS = uint64(60) var ( addrLockedGns = make(map[std.Address][]lockedGNS) diff --git a/gov/staker/tests/__TEST_api_test.gnoA b/gov/staker/tests/__TEST_api_test.gnoA index 8b67f1c95..deab52920 100644 --- a/gov/staker/tests/__TEST_api_test.gnoA +++ b/gov/staker/tests/__TEST_api_test.gnoA @@ -67,7 +67,7 @@ func redelegateUnknownFrom(t *testing.T) { t.Run("unknown address redelegate", func(t *testing.T) { std.TestSetRealm(adminRealm) - uassert.PanicsWithMessage(t, "caller g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c has no delegated amount to g1wfj5getvv4nkzar9ta047h6lta047h6lycyuqt", func() { + uassert.PanicsWithMessage(t, "caller g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d has no delegated amount to g1wfj5getvv4nkzar9ta047h6lta047h6lycyuqt", func() { Redelegate(reDelegate, dummyAddr, 1000001) }) diff --git a/gov/staker/tests/clean_delegation_stat_history_test.gnoA b/gov/staker/tests/clean_delegation_stat_history_test.gnoA index 2b005528d..eddd1ae72 100644 --- a/gov/staker/tests/clean_delegation_stat_history_test.gnoA +++ b/gov/staker/tests/clean_delegation_stat_history_test.gnoA @@ -11,7 +11,7 @@ import ( func TestCleanDelegationStatHistoryPermission(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-GOV_STAKER-001] caller has no permission || clean_delegation_stat_history.gno__CleanDelegationStatHistoryByAdmin() || prev(g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm) != admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c)`, + `[GNOSWAP-GOV_STAKER-001] caller has no permission || clean_delegation_stat_history.gno__CleanDelegationStatHistoryByAdmin() || prev(g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm) != admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d)`, func() { CleanDelegationStatHistoryByAdmin() }, @@ -26,7 +26,7 @@ func TestCleanDelegationStatHistoryPermission(t *testing.T) { func TestSetRunningPermission(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-GOV_STAKER-001] caller has no permission || clean_delegation_stat_history.gno__SetRunning() || prev(g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm) != admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c)`, + `[GNOSWAP-GOV_STAKER-001] caller has no permission || clean_delegation_stat_history.gno__SetRunning() || prev(g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm) != admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d)`, func() { SetRunning(false) }, diff --git a/launchpad/consts.gno b/launchpad/consts.gno index 434ae98ad..69bcabd9a 100644 --- a/launchpad/consts.gno +++ b/launchpad/consts.gno @@ -4,26 +4,13 @@ const ( minimumGnsAmount = 1_000_000 ) -// ORIG TIME -// const ( -// TIMESTAMP_180DAYS = uint64(180 * 24 * 60 * 60) // 15552000 -// TIMESTAMP_14DAYS = uint64(14 * 24 * 60 * 60) // 1209600 - -// TIMESTAMP_90DAYS = uint64(90 * 24 * 60 * 60) // 7776000 -// TIMESTAMP_7DAYS = uint64(7 * 24 * 60 * 60) // 604800 - -// TIMESTAMP_30DAYS = uint64(30 * 24 * 60 * 60) // 2592000 -// TIMESTAMP_3DAYS = uint64(3 * 24 * 60 * 60) // 259200 -// ) - -// QA TIME const ( - TIMESTAMP_180DAYS = uint64(180 * 60) - TIMESTAMP_14DAYS = uint64(14 * 60) + TIMESTAMP_180DAYS = uint64(180 * 24 * 60 * 60) // 15552000 + TIMESTAMP_14DAYS = uint64(14 * 24 * 60 * 60) // 1209600 - TIMESTAMP_90DAYS = uint64(90 * 60) - TIMESTAMP_7DAYS = uint64(7 * 60) + TIMESTAMP_90DAYS = uint64(90 * 24 * 60 * 60) // 7776000 + TIMESTAMP_7DAYS = uint64(7 * 24 * 60 * 60) // 604800 - TIMESTAMP_30DAYS = uint64(30 * 60) - TIMESTAMP_3DAYS = uint64(3 * 60) + TIMESTAMP_30DAYS = uint64(30 * 24 * 60 * 60) // 2592000 + TIMESTAMP_3DAYS = uint64(3 * 24 * 60 * 60) // 259200 ) diff --git a/pool/tests/__TEST_pool_single_lp_test.gnoA b/pool/tests/__TEST_pool_single_lp_test.gnoA index 1d3277bb8..f15e39e7c 100644 --- a/pool/tests/__TEST_pool_single_lp_test.gnoA +++ b/pool/tests/__TEST_pool_single_lp_test.gnoA @@ -312,7 +312,7 @@ func TestSetFeeProtocolByAdmin(t *testing.T) { // non admin call uassert.PanicsWithMessage( t, - `[GNOSWAP-POOL-001] caller has no permission || pool.gno__SetFeeProtocolByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can set fee protocol, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`, + `[GNOSWAP-POOL-001] caller has no permission || pool.gno__SetFeeProtocolByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can set fee protocol, called from g1wymu47drhr0kuq2098m792lytgtj2nyx77yrsm`, func() { SetFeeProtocolByAdmin(2, 2) }, ) diff --git a/pool/tests/__TEST_pool_spec_#2_test.gnoA b/pool/tests/__TEST_pool_spec_#2_test.gnoA index 724865726..070fde8ad 100644 --- a/pool/tests/__TEST_pool_spec_#2_test.gnoA +++ b/pool/tests/__TEST_pool_spec_#2_test.gnoA @@ -54,7 +54,7 @@ func TestSuccess_case_init_balance(t *testing.T) { poolPath := "gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:3000" std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", minTick, maxTick, "3161", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", minTick, maxTick, "3161", admin) // ===================== initial balance ======================== @@ -81,7 +81,7 @@ func TestSuccess_case_init_tick(t *testing.T) { poolPath := "gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:3000" std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", minTick, maxTick, "3161", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", minTick, maxTick, "3161", admin) // ===================== initial tick ======================== @@ -106,12 +106,12 @@ func TestSuccess_case_transfer_token0_only(t *testing.T) { poolPath := "gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:3000" std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", minTick, maxTick, "3161", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", minTick, maxTick, "3161", admin) // ===================== transfer token0 only ======================== std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", -22980, 0, "10000", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", -22980, 0, "10000", admin) barBalance := bar.BalanceOf(a2u(consts.POOL_ADDR)) fooBalance := foo.BalanceOf(a2u(consts.POOL_ADDR)) @@ -135,7 +135,7 @@ func TestSuccess_case_max_tick_with_max_leverage(t *testing.T) { poolPath := "gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:3000" std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", minTick, maxTick, "3161", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", minTick, maxTick, "3161", admin) // ===================== max tick with max leverage ======================== @@ -143,7 +143,7 @@ func TestSuccess_case_max_tick_with_max_leverage(t *testing.T) { tickSpacing := pool.tickSpacing std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", maxTick-tickSpacing, maxTick, "5070602400912917605986812821504", admin) // 2**102 + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", maxTick-tickSpacing, maxTick, "5070602400912917605986812821504", admin) // 2**102 barBalance := bar.BalanceOf(a2u(consts.POOL_ADDR)) fooBalance := foo.BalanceOf(a2u(consts.POOL_ADDR)) @@ -167,7 +167,7 @@ func TestSuccess_case_work_for_max_tick(t *testing.T) { poolPath := "gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:3000" std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", minTick, maxTick, "3161", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", minTick, maxTick, "3161", admin) // ===================== work for max tick ======================== @@ -175,7 +175,7 @@ func TestSuccess_case_work_for_max_tick(t *testing.T) { tickSpacing := pool.tickSpacing std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", -22980, maxTick, "10000", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", -22980, maxTick, "10000", admin) barBalance := bar.BalanceOf(a2u(consts.POOL_ADDR)) fooBalance := foo.BalanceOf(a2u(consts.POOL_ADDR)) @@ -199,7 +199,7 @@ func TestSuccess_case_removing_works(t *testing.T) { poolPath := "gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:3000" std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", minTick, maxTick, "3161", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", minTick, maxTick, "3161", admin) // ===================== removing works ======================== @@ -207,7 +207,7 @@ func TestSuccess_case_removing_works(t *testing.T) { tickSpacing := pool.tickSpacing std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", -240, 0, "10000", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", -240, 0, "10000", admin) uassert.PanicsWithMessage( t, @@ -234,7 +234,7 @@ func TestSuccess_case_adds_liquidity_to_liquidityGross(t *testing.T) { poolPath := "gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:3000" std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", minTick, maxTick, "3161", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", minTick, maxTick, "3161", admin) // ===================== adds liquidity to liquiditygross ======================== @@ -242,7 +242,7 @@ func TestSuccess_case_adds_liquidity_to_liquidityGross(t *testing.T) { tickSpacing := pool.tickSpacing std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", -240, 0, "100", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", -240, 0, "100", admin) _, _, liquidityGross, _, _, _, _, _ := pool.GetTicks(-240) uassert.Equal(t, liquidityGross.ToString(), "100") _, _, liquidityGross, _, _, _, _, _ = pool.GetTicks(0) @@ -253,7 +253,7 @@ func TestSuccess_case_adds_liquidity_to_liquidityGross(t *testing.T) { uassert.Equal(t, liquidityGross.ToString(), "0") std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", -240, tickSpacing, "150", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", -240, tickSpacing, "150", admin) _, _, liquidityGross, _, _, _, _, _ = pool.GetTicks(-240) uassert.Equal(t, liquidityGross.ToString(), "250") _, _, liquidityGross, _, _, _, _, _ = pool.GetTicks(0) @@ -264,7 +264,7 @@ func TestSuccess_case_adds_liquidity_to_liquidityGross(t *testing.T) { uassert.Equal(t, liquidityGross.ToString(), "0") std.TestSetRealm(posRealm) - pl.Mint(token0Path, barPath, 3000, "g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c", 0, tickSpacing*2, "60", admin) + pl.Mint(token0Path, barPath, 3000, "g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d", 0, tickSpacing*2, "60", admin) _, _, liquidityGross, _, _, _, _, _ = pool.GetTicks(-240) uassert.Equal(t, liquidityGross.ToString(), "250") _, _, liquidityGross, _, _, _, _, _ = pool.GetTicks(0) diff --git a/pool/tests/__TEST_pool_test.gnoA b/pool/tests/__TEST_pool_test.gnoA index 98b6532bc..017ffc5e6 100644 --- a/pool/tests/__TEST_pool_test.gnoA +++ b/pool/tests/__TEST_pool_test.gnoA @@ -131,7 +131,7 @@ func TestSetWithdrawalFeeByAdminNoPermission(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-POOL-001] caller has no permission || protocol_fee_withdrawal.gno__SetWithdrawalFeeByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can set withdrawal fee, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, + `[GNOSWAP-POOL-001] caller has no permission || protocol_fee_withdrawal.gno__SetWithdrawalFeeByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can set withdrawal fee, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, func() { SetWithdrawalFeeByAdmin(2) }, @@ -167,7 +167,7 @@ func TestSetPoolCreationFeeByAdminNoPermission(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-POOL-001] caller has no permission || protocol_fee_pool_creation.gno__SetPoolCreationFeeByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can set pool creation fee, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, + `[GNOSWAP-POOL-001] caller has no permission || protocol_fee_pool_creation.gno__SetPoolCreationFeeByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can set pool creation fee, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, func() { SetPoolCreationFeeByAdmin(2) }, diff --git a/position/tests/__TEST_position_reposition_grc20_pair_test.gnoA b/position/tests/__TEST_position_reposition_grc20_pair_test.gnoA index 53c8f67e3..944827793 100644 --- a/position/tests/__TEST_position_reposition_grc20_pair_test.gnoA +++ b/position/tests/__TEST_position_reposition_grc20_pair_test.gnoA @@ -226,7 +226,7 @@ func TestRepositionNotOwner(t *testing.T) { std.TestSetRealm(std.NewUserRealm(test1)) uassert.PanicsWithMessage( t, - `[GNOSWAP-POSITION-001] caller has no permission || position.gno__Reposition() || only owner(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can reposition for tokenId(1), but called from g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5`, + `[GNOSWAP-POSITION-001] caller has no permission || position.gno__Reposition() || only owner(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can reposition for tokenId(1), but called from g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5`, func() { Reposition(uint64(1), -1000, 1000, "500", "500", "0", "0") }) diff --git a/protocol_fee/tests/__TEST_protocol_fee_test.gnoA b/protocol_fee/tests/__TEST_protocol_fee_test.gnoA index e024c070c..71a5fbbcd 100644 --- a/protocol_fee/tests/__TEST_protocol_fee_test.gnoA +++ b/protocol_fee/tests/__TEST_protocol_fee_test.gnoA @@ -47,7 +47,7 @@ func TestSetDevOpsPctByAdminNoPermission(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-PROTOCOL_FEE-001] caller has no permission || protocol_fee.gno__SetDevOpsPctByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can set devOpsPct, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, + `[GNOSWAP-PROTOCOL_FEE-001] caller has no permission || protocol_fee.gno__SetDevOpsPctByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can set devOpsPct, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, func() { SetDevOpsPctByAdmin(123) }, diff --git a/staker/staker.gno b/staker/staker.gno index 02919f6b1..fe95cec3e 100644 --- a/staker/staker.gno +++ b/staker/staker.gno @@ -39,15 +39,9 @@ var ( ) const ( - // ORIG TIME - // TIMESTAMP_90DAYS = 7776000 - // TIMESTAMP_180DAYS = 15552000 - // TIMESTAMP_365DAYS = 31536000 - - // QA TIME - TIMESTAMP_90DAYS = 5400 // 90 minute - TIMESTAMP_180DAYS = 10800 // 180 minute - TIMESTAMP_365DAYS = 21900 // 365 minute + TIMESTAMP_90DAYS = 7776000 + TIMESTAMP_180DAYS = 15552000 + TIMESTAMP_365DAYS = 31536000 MAX_UNIX_EPOCH_TIME = 253402300799 // 9999-12-31 23:59:59 diff --git a/staker/tests/__TEST_staker_NFT_transfer_03_test.gnoA b/staker/tests/__TEST_staker_NFT_transfer_03_test.gnoA index e549724ae..1bc39c3ed 100644 --- a/staker/tests/__TEST_staker_NFT_transfer_03_test.gnoA +++ b/staker/tests/__TEST_staker_NFT_transfer_03_test.gnoA @@ -116,7 +116,7 @@ func testStakeToken01(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-STAKER-001] caller has no permission || staker.gno__StakeToken() || caller(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) or staker(g1cceshmzzlmrh7rr3z30j2t5mrvsq9yccysw9nu) is not owner(g1v36k6mteta047h6lta047h6lta047h6lz7gmv8) of tokenId(1)`, + `[GNOSWAP-STAKER-001] caller has no permission || staker.gno__StakeToken() || caller(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) or staker(g1cceshmzzlmrh7rr3z30j2t5mrvsq9yccysw9nu) is not owner(g1v36k6mteta047h6lta047h6lta047h6lz7gmv8) of tokenId(1)`, func() { std.TestSetRealm(adminRealm) StakeToken(1) @@ -141,7 +141,7 @@ func testCollectReward01(t *testing.T) { t.Run("admin can not collect reward(not a owner)", func(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-STAKER-001] caller has no permission || staker.gno__CollectReward() || only owner(g1v36k6mteta047h6lta047h6lta047h6lz7gmv8) can collect reward from tokenId(1), called from g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c`, + `[GNOSWAP-STAKER-001] caller has no permission || staker.gno__CollectReward() || only owner(g1v36k6mteta047h6lta047h6lta047h6lz7gmv8) can collect reward from tokenId(1), called from g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d`, func() { std.TestSetRealm(adminRealm) CollectReward(1, false) diff --git a/staker/tests/__TEST_staker_rpc_api_test.gnoA b/staker/tests/__TEST_staker_rpc_api_test.gnoA index 58e1e4e7d..908e7dd61 100644 --- a/staker/tests/__TEST_staker_rpc_api_test.gnoA +++ b/staker/tests/__TEST_staker_rpc_api_test.gnoA @@ -365,7 +365,7 @@ func testApiGetRewardTokensByPoolPath(t *testing.T) { func testApiGetExternalIncentives(t *testing.T) { t.Run("api get external incentives", func(t *testing.T) { extIncen := ApiGetExternalIncentives() - res := `{"stat":{"height":150,"timestamp":1234567944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"100000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":140,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":142,"depositGnsAmount":1000000000},{"incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"500000000","rewardLeft":"500000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1w3jhxazpv3j8yh6lta047h6lta047h6lke9x4e","createdHeight":144,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/gnoswap/v1/gns","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":146,"depositGnsAmount":1000000000}]}` + res := `{"stat":{"height":150,"timestamp":1234567944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"100000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":140,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":142,"depositGnsAmount":1000000000},{"incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"500000000","rewardLeft":"500000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1w3jhxazpv3j8yh6lta047h6lta047h6lke9x4e","createdHeight":144,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/gnoswap/v1/gns","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":146,"depositGnsAmount":1000000000}]}` uassert.Equal(t, extIncen, res) }) } @@ -373,7 +373,7 @@ func testApiGetExternalIncentives(t *testing.T) { func testApiGetExternalIncentiveById(t *testing.T) { t.Run("get external incentive by id", func(t *testing.T) { extIncen := ApiGetExternalIncentiveById("ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==") - res := `{"stat":{"height":150,"timestamp":1234567944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"100000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":140,"depositGnsAmount":1000000000}]}` + res := `{"stat":{"height":150,"timestamp":1234567944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"100000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":140,"depositGnsAmount":1000000000}]}` uassert.Equal(t, extIncen, res) }) } @@ -381,7 +381,7 @@ func testApiGetExternalIncentiveById(t *testing.T) { func testApiGetExternalIncentivesByPoolPath(t *testing.T) { t.Run("get external incentives by pool path", func(t *testing.T) { extIncen := ApiGetExternalIncentivesByPoolPath("gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500") - res := `{"stat":{"height":150,"timestamp":1234567944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"100000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":140,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":142,"depositGnsAmount":1000000000},{"incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"500000000","rewardLeft":"500000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1w3jhxazpv3j8yh6lta047h6lta047h6lke9x4e","createdHeight":144,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/gnoswap/v1/gns","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":146,"depositGnsAmount":1000000000}]}` + res := `{"stat":{"height":150,"timestamp":1234567944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"100000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":140,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":142,"depositGnsAmount":1000000000},{"incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"500000000","rewardLeft":"500000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1w3jhxazpv3j8yh6lta047h6lta047h6lke9x4e","createdHeight":144,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/gnoswap/v1/gns","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":146,"depositGnsAmount":1000000000}]}` uassert.Equal(t, extIncen, res) }) } @@ -389,7 +389,7 @@ func testApiGetExternalIncentivesByPoolPath(t *testing.T) { func testApiGetExternalIncentivesByRewardTokenPath(t *testing.T) { t.Run("get external incentives by reward token path", func(t *testing.T) { extIncen := ApiGetExternalIncentivesByRewardTokenPath("gno.land/r/onbloc/obl") - res := `{"stat":{"height":150,"timestamp":1234567944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"100000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":140,"depositGnsAmount":1000000000}]}` + res := `{"stat":{"height":150,"timestamp":1234567944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"1000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"100000000","startTimestamp":1234569600,"endTimestamp":1242345600,"active":false,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":140,"depositGnsAmount":1000000000}]}` uassert.Equal(t, extIncen, res) }) } @@ -433,7 +433,7 @@ func testApiGetRewards(t *testing.T) { } rewards := ApiGetRewards() - res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":369114986,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234567938},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":2201,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":204,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":1026,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2037161166,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234567940},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":12200,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":1137,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":11385,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":5692,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":11385,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600}]},{"lpTokenId":3,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/baz:gno.land/r/onbloc/qux:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2058005077,"stakeTimestamp":1234567942,"stakeHeight":149,"incentiveStart":1234567942}]}]}` + res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":369114986,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234567938},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":2201,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":204,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":1026,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2037161166,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234567940},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":12200,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":1137,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":11385,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":5692,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":11385,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600}]},{"lpTokenId":3,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/baz:gno.land/r/onbloc/qux:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2058005077,"stakeTimestamp":1234567942,"stakeHeight":149,"incentiveStart":1234567942}]}]}` uassert.Equal(t, rewards, res) }) } @@ -441,15 +441,15 @@ func testApiGetRewards(t *testing.T) { func testApiGetRewardsByLpTokenId(t *testing.T) { t.Run("get rewards by lp token id", func(t *testing.T) { rewards := ApiGetRewardsByLpTokenId(uint64(1)) - res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":369114986,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234567938},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":2201,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":204,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":1026,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600}]}]}` + res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":369114986,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234567938},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":2201,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":204,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":1026,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600}]}]}` uassert.Equal(t, rewards, res) }) } func testApiGetRewardsByAddress(t *testing.T) { t.Run("get rewards by address", func(t *testing.T) { - rewards := ApiGetRewardsByAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") - res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":369114986,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234567938},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":2201,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":204,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":1026,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2037161166,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234567940},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":12200,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":1137,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":11385,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":5692,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":11385,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600}]},{"lpTokenId":3,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/baz:gno.land/r/onbloc/qux:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2058005077,"stakeTimestamp":1234567942,"stakeHeight":149,"incentiveStart":1234567942}]}]}` + rewards := ApiGetRewardsByAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") + res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":369114986,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234567938},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":2201,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":204,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":1026,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2053,"stakeTimestamp":1234567938,"stakeHeight":147,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2037161166,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234567940},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":12200,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":1137,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":11385,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/onbloc/foo","rewardTokenAmount":5692,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":11385,"stakeTimestamp":1234567940,"stakeHeight":148,"incentiveStart":1234569600}]},{"lpTokenId":3,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/baz:gno.land/r/onbloc/qux:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":2058005077,"stakeTimestamp":1234567942,"stakeHeight":149,"incentiveStart":1234567942}]}]}` uassert.Equal(t, rewards, res) }) } @@ -457,7 +457,7 @@ func testApiGetRewardsByAddress(t *testing.T) { func testApiGetStakes(t *testing.T) { t.Run("get stakes", func(t *testing.T) { stakes := ApiGetStakes() - res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"tokenId":1,"owner":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","numberOfStakes":1,"stakeTimestamp":1234567938,"stakeHeight":147,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"},{"tokenId":2,"owner":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","numberOfStakes":1,"stakeTimestamp":1234567940,"stakeHeight":148,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"},{"tokenId":3,"owner":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","numberOfStakes":1,"stakeTimestamp":1234567942,"stakeHeight":149,"targetPoolPath":"gno.land/r/onbloc/baz:gno.land/r/onbloc/qux:500"}]}` + res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"tokenId":1,"owner":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","numberOfStakes":1,"stakeTimestamp":1234567938,"stakeHeight":147,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"},{"tokenId":2,"owner":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","numberOfStakes":1,"stakeTimestamp":1234567940,"stakeHeight":148,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"},{"tokenId":3,"owner":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","numberOfStakes":1,"stakeTimestamp":1234567942,"stakeHeight":149,"targetPoolPath":"gno.land/r/onbloc/baz:gno.land/r/onbloc/qux:500"}]}` uassert.Equal(t, stakes, res) }) } @@ -465,15 +465,15 @@ func testApiGetStakes(t *testing.T) { func testApiGetStakesByLpTokenId(t *testing.T) { t.Run("get stakes by lp token id", func(t *testing.T) { stakes := ApiGetStakesByLpTokenId(uint64(1)) - res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"tokenId":1,"owner":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","numberOfStakes":1,"stakeTimestamp":1234567938,"stakeHeight":147,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"}]}` + res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"tokenId":1,"owner":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","numberOfStakes":1,"stakeTimestamp":1234567938,"stakeHeight":147,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"}]}` uassert.Equal(t, stakes, res) }) } func testApiGetStakesByAddress(t *testing.T) { t.Run("get stakes by address", func(t *testing.T) { - stakes := ApiGetStakesByAddress("g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c") - res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"tokenId":1,"owner":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","numberOfStakes":1,"stakeTimestamp":1234567938,"stakeHeight":147,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"},{"tokenId":2,"owner":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","numberOfStakes":1,"stakeTimestamp":1234567940,"stakeHeight":148,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"},{"tokenId":3,"owner":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","numberOfStakes":1,"stakeTimestamp":1234567942,"stakeHeight":149,"targetPoolPath":"gno.land/r/onbloc/baz:gno.land/r/onbloc/qux:500"}]}` + stakes := ApiGetStakesByAddress("g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d") + res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"tokenId":1,"owner":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","numberOfStakes":1,"stakeTimestamp":1234567938,"stakeHeight":147,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"},{"tokenId":2,"owner":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","numberOfStakes":1,"stakeTimestamp":1234567940,"stakeHeight":148,"targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500"},{"tokenId":3,"owner":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","numberOfStakes":1,"stakeTimestamp":1234567942,"stakeHeight":149,"targetPoolPath":"gno.land/r/onbloc/baz:gno.land/r/onbloc/qux:500"}]}` uassert.Equal(t, stakes, res) }) } @@ -492,7 +492,7 @@ func testSetUnstakingFeeNoPermission(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-STAKER-001] caller has no permission || reward_fee.gno__SetUnstakingFeeByAdmin() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) can set unstaking fee, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, + `[GNOSWAP-STAKER-001] caller has no permission || reward_fee.gno__SetUnstakingFeeByAdmin() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) can set unstaking fee, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, func() { SetUnstakingFeeByAdmin(2) }, @@ -527,7 +527,7 @@ func testSetUnstakingFee(t *testing.T) { func testApiGetExternalIncentivesOrig(t *testing.T) { t.Run("external incentive orig", func(t *testing.T) { extIncen := ApiGetExternalIncentives() - res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"999955764","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"99995579","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":140,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"1000000000","rewardLeft":"999955764","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":142,"depositGnsAmount":1000000000},{"incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"500000000","rewardLeft":"499977883","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1w3jhxazpv3j8yh6lta047h6lta047h6lke9x4e","createdHeight":144,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/gnoswap/v1/gns","rewardAmount":"1000000000","rewardLeft":"999955764","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":146,"depositGnsAmount":1000000000}]}` + res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"999955764","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"99995579","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":140,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"1000000000","rewardLeft":"999955764","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":142,"depositGnsAmount":1000000000},{"incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"500000000","rewardLeft":"499977883","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1w3jhxazpv3j8yh6lta047h6lta047h6lke9x4e","createdHeight":144,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/gnoswap/v1/gns","rewardAmount":"1000000000","rewardLeft":"999955764","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":146,"depositGnsAmount":1000000000}]}` uassert.Equal(t, extIncen, res) }) } @@ -541,7 +541,7 @@ func testApiGetExternalIncentivesAfterCollectReward(t *testing.T) { CollectReward(3, false) extIncen := ApiGetExternalIncentives() - res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"999911528","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"99991158","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":140,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"1000000000","rewardLeft":"999911528","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":142,"depositGnsAmount":1000000000},{"incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"500000000","rewardLeft":"499955766","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1w3jhxazpv3j8yh6lta047h6lta047h6lke9x4e","createdHeight":144,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/gnoswap/v1/gns","rewardAmount":"1000000000","rewardLeft":"999911528","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","createdHeight":146,"depositGnsAmount":1000000000}]}` + res := `{"stat":{"height":1150,"timestamp":1234569944},"response":[{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzOA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"1000000000","rewardLeft":"999911528","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":138,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0MA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/obl","rewardAmount":"100000000","rewardLeft":"99991158","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":140,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0Mg==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"1000000000","rewardLeft":"999911528","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":142,"depositGnsAmount":1000000000},{"incentiveId":"ZzF3M2poeGF6cHYzajh5aDZsdGEwNDdoNmx0YTA0N2g2bGtlOXg0ZTpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL29uYmxvYy9mb286MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjE0NA==","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/onbloc/foo","rewardAmount":"500000000","rewardLeft":"499955766","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g1w3jhxazpv3j8yh6lta047h6lta047h6lke9x4e","createdHeight":144,"depositGnsAmount":1000000000},{"incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvZm9vOjUwMDpnbm8ubGFuZC9yL2dub3N3YXAvdjIvZ25zOjEyMzQ1Njk2MDA6MTI0MjM0NTYwMDoxNDY=","poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/foo:500","rewardToken":"gno.land/r/gnoswap/v1/gns","rewardAmount":"1000000000","rewardLeft":"999911528","startTimestamp":1234569600,"endTimestamp":1242345600,"active":true,"refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","createdHeight":146,"depositGnsAmount":1000000000}]}` uassert.Equal(t, extIncen, res) }) } diff --git a/staker/tests/__TEST_staker_short-warmup_period_collect_reward_test.gnoA b/staker/tests/__TEST_staker_short-warmup_period_collect_reward_test.gnoA index 22ffef731..d8d632014 100644 --- a/staker/tests/__TEST_staker_short-warmup_period_collect_reward_test.gnoA +++ b/staker/tests/__TEST_staker_short-warmup_period_collect_reward_test.gnoA @@ -238,7 +238,7 @@ func testUnstakeToken01(t *testing.T) { uassert.Equal(t, obl.BalanceOf(a2u(admin)), uint64(99999000000000)) // external response := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, response, `{"stat":{"height":1041,"timestamp":1234569726},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":445623695,"stakeTimestamp":1234567914,"stakeHeight":135,"incentiveStart":1234567914},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzMw==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":743,"stakeTimestamp":1234567914,"stakeHeight":135,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, response, `{"stat":{"height":1041,"timestamp":1234569726},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:500","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":445623695,"stakeTimestamp":1234567914,"stakeHeight":135,"incentiveStart":1234567914},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjUwMDpnbm8ubGFuZC9yL29uYmxvYy9vYmw6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEzMw==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:500","rewardTokenPath":"gno.land/r/onbloc/obl","rewardTokenAmount":743,"stakeTimestamp":1234567914,"stakeHeight":135,"incentiveStart":1234569600}]}]}`) UnstakeToken(1, false) // GNFT tokenId std.TestSkipHeights(1) diff --git a/staker/tests/__TEST_staker_short_warmup_period_external_10_test.gnoA b/staker/tests/__TEST_staker_short_warmup_period_external_10_test.gnoA index 01794d87a..f7b51b7cd 100644 --- a/staker/tests/__TEST_staker_short_warmup_period_external_10_test.gnoA +++ b/staker/tests/__TEST_staker_short_warmup_period_external_10_test.gnoA @@ -148,7 +148,7 @@ func testAfterActive(t *testing.T) { std.TestSkipHeights(50) // skip 50 more block pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1028,"time":1234569700,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":50,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":257,"tokenAmountToGive":77,"full30":257,"give30":77,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1028,"time":1234569700,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":50,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":257,"tokenAmountToGive":77,"full30":257,"give30":77,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) }) } @@ -157,7 +157,7 @@ func testDuratino200(t *testing.T) { std.TestSkipHeights(199) // skip 1 + 199 = 200 more block pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1227,"time":1234570098,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":249,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":1280,"tokenAmountToGive":485,"full30":771,"give30":231,"full50":509,"give50":254,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1227,"time":1234570098,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":249,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":1280,"tokenAmountToGive":485,"full30":771,"give30":231,"full50":509,"give50":254,"full70":0,"give70":0,"full100":0}]}]}`) }) } @@ -172,7 +172,7 @@ func testCollectReward(t *testing.T) { uassert.Equal(t, newBar-oldBar, uint64(481)) pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1228,"time":1234570100,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":250,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":5,"tokenAmountToGive":2,"full30":0,"give30":0,"full50":5,"give50":2,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1228,"time":1234570100,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":250,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":5,"tokenAmountToGive":2,"full30":0,"give30":0,"full50":5,"give50":2,"full70":0,"give70":0,"full100":0}]}]}`) }) } @@ -209,7 +209,7 @@ func testSkipSingleBlock(t *testing.T) { t.Run("skip single block", func(t *testing.T) { // skipped 1 block from previous test pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1229,"time":1234570102,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":251,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":10,"tokenAmountToGive":4,"full30":0,"give30":0,"full50":10,"give50":4,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1229,"time":1234570102,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":251,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":10,"tokenAmountToGive":4,"full30":0,"give30":0,"full50":10,"give50":4,"full70":0,"give70":0,"full100":0}]}]}`) }) } @@ -229,7 +229,7 @@ func testSingleBlock_TwoPosition(t *testing.T) { // skipped 1 block from previous test pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1230,"time":1234570104,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":252,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":12,"tokenAmountToGive":5,"full30":0,"give30":0,"full50":12,"give50":5,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":1,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":2,"tokenAmountToGive":0,"full30":2,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1230,"time":1234570104,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":252,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":12,"tokenAmountToGive":5,"full30":0,"give30":0,"full50":12,"give50":5,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":1,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":2,"tokenAmountToGive":0,"full30":2,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) std.TestSkipHeights(1) }) @@ -240,7 +240,7 @@ func testCollectRewardAll(t *testing.T) { std.TestSkipHeights(10) pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1241,"time":1234570126,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":263,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":40,"tokenAmountToGive":19,"full30":0,"give30":0,"full50":40,"give50":19,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":12,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":30,"tokenAmountToGive":8,"full30":30,"give30":8,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1241,"time":1234570126,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":263,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":40,"tokenAmountToGive":19,"full30":0,"give30":0,"full50":40,"give50":19,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":12,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":30,"tokenAmountToGive":8,"full30":30,"give30":8,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) std.TestSetRealm(adminRealm) @@ -259,6 +259,6 @@ func testCollectRewardAll(t *testing.T) { func testPrintAfterCollect(t *testing.T) { t.Run("print after collect", func(t *testing.T) { pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1241,"time":1234570126,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":263,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":0,"tokenAmountToGive":0,"full30":0,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":12,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":0,"tokenAmountToGive":0,"full30":0,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1241,"time":1234570126,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":263,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":0,"tokenAmountToGive":0,"full30":0,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":12,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":0,"tokenAmountToGive":0,"full30":0,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) }) } diff --git a/staker/tests/__TEST_staker_short_warmup_period_external_11_q96_test.gnoA b/staker/tests/__TEST_staker_short_warmup_period_external_11_q96_test.gnoA index 601539e80..57a826982 100644 --- a/staker/tests/__TEST_staker_short_warmup_period_external_11_q96_test.gnoA +++ b/staker/tests/__TEST_staker_short_warmup_period_external_11_q96_test.gnoA @@ -139,7 +139,7 @@ func testAfterActive(t *testing.T) { std.TestSkipHeights(50) // skip 50 more block pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1028,"time":1234569700,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":50,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":257,"tokenAmountToGive":77,"full30":257,"give30":77,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1028,"time":1234569700,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":50,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":257,"tokenAmountToGive":77,"full30":257,"give30":77,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) }) } @@ -148,7 +148,7 @@ func testDuratino200(t *testing.T) { std.TestSkipHeights(199) // skip 1 + 199 = 200 more block pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1227,"time":1234570098,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":249,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":1280,"tokenAmountToGive":485,"full30":771,"give30":231,"full50":509,"give50":254,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1227,"time":1234570098,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":249,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":1280,"tokenAmountToGive":485,"full30":771,"give30":231,"full50":509,"give50":254,"full70":0,"give70":0,"full100":0}]}]}`) }) } @@ -163,7 +163,7 @@ func testCollectReward(t *testing.T) { uassert.Equal(t, newBar-oldBar, uint64(481)) pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1228,"time":1234570100,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":250,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":5,"tokenAmountToGive":2,"full30":0,"give30":0,"full50":5,"give50":2,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1228,"time":1234570100,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":250,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":5,"tokenAmountToGive":2,"full30":0,"give30":0,"full50":5,"give50":2,"full70":0,"give70":0,"full100":0}]}]}`) }) } @@ -201,7 +201,7 @@ func testSkipSingleBlock(t *testing.T) { // skipped 1 block from previous test pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1229,"time":1234570102,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":251,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":10,"tokenAmountToGive":4,"full30":0,"give30":0,"full50":10,"give50":4,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1229,"time":1234570102,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":251,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":10,"tokenAmountToGive":4,"full30":0,"give30":0,"full50":10,"give50":4,"full70":0,"give70":0,"full100":0}]}]}`) }) } @@ -221,7 +221,7 @@ func testSingleBlock_TwoPosition(t *testing.T) { // skipped 1 block from previous test pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1230,"time":1234570104,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":252,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":12,"tokenAmountToGive":5,"full30":0,"give30":0,"full50":12,"give50":5,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":1,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":2,"tokenAmountToGive":0,"full30":2,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1230,"time":1234570104,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":252,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":12,"tokenAmountToGive":5,"full30":0,"give30":0,"full50":12,"give50":5,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":1,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":2,"tokenAmountToGive":0,"full30":2,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) std.TestSkipHeights(1) }) @@ -232,7 +232,7 @@ func testCollectRewardAll(t *testing.T) { std.TestSkipHeights(10) pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1241,"time":1234570126,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":263,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":40,"tokenAmountToGive":19,"full30":0,"give30":0,"full50":40,"give50":19,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":12,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":30,"tokenAmountToGive":8,"full30":30,"give30":8,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1241,"time":1234570126,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":263,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":40,"tokenAmountToGive":19,"full30":0,"give30":0,"full50":40,"give50":19,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":12,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":30,"tokenAmountToGive":8,"full30":30,"give30":8,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) std.TestSetRealm(adminRealm) @@ -251,6 +251,6 @@ func testCollectRewardAll(t *testing.T) { func testPrintAfterCollect(t *testing.T) { t.Run("print external, after collect", func(t *testing.T) { pei := GetPrintExternalInfo() - uassert.Equal(t, pei, `{"height":1241,"time":1234570126,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":263,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":0,"tokenAmountToGive":0,"full30":0,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":12,"rewardPerBlock":"5","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":0,"tokenAmountToGive":0,"full30":0,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) + uassert.Equal(t, pei, `{"height":1241,"time":1234570126,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":263,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":0,"tokenAmountToGive":0,"full30":0,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]},{"lpTokenId":2,"stakedHeight":1229,"stakedTimestamp":1234570102,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardToken":"gno.land/r/onbloc/bar","rewardAmount":"20000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"407552276307944123423579991440","stakedOrExternalDuration":12,"rewardPerBlock":"5","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":0,"tokenAmountToGive":0,"full30":0,"give30":0,"full50":0,"give50":0,"full70":0,"give70":0,"full100":0}]}]}`) }) } diff --git a/staker/tests/__TEST_staker_short_warmup_period_external_14_position_in_out_range_changed_by_swap_test.gnoA b/staker/tests/__TEST_staker_short_warmup_period_external_14_position_in_out_range_changed_by_swap_test.gnoA index e62a539d3..305815b09 100644 --- a/staker/tests/__TEST_staker_short_warmup_period_external_14_position_in_out_range_changed_by_swap_test.gnoA +++ b/staker/tests/__TEST_staker_short_warmup_period_external_14_position_in_out_range_changed_by_swap_test.gnoA @@ -159,10 +159,10 @@ func testBeforeActive(t *testing.T) { uassert.Equal(t, pei, `{"height":128,"time":1234567900,"position":[]}`) lp01ExternalRewards := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[]}]}`) + uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[]}]}`) lp02ExternalRewards := ApiGetRewardsByLpTokenId(2) - uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[]}]}`) + uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[]}]}`) }) } @@ -170,10 +170,10 @@ func testAfter849Blocks(t *testing.T) { t.Run("after 849 blocks", func(t *testing.T) { std.TestSkipHeights(849) // in-active lp01ExternalRewards := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":977,"timestamp":1234569598},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[]}]}`) + uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":977,"timestamp":1234569598},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[]}]}`) lp02ExternalRewards := ApiGetRewardsByLpTokenId(2) - uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":977,"timestamp":1234569598},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[]}]}`) + uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":977,"timestamp":1234569598},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[]}]}`) }) } @@ -181,10 +181,10 @@ func testAfter1Block(t *testing.T) { t.Run("after 1 block", func(t *testing.T) { std.TestSkipHeights(1) // active // but no block passed since active lp01ExternalRewards := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":978,"timestamp":1234569600},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[]}]}`) + uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":978,"timestamp":1234569600},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[]}]}`) lp02ExternalRewards := ApiGetRewardsByLpTokenId(2) - uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":978,"timestamp":1234569600},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[]}]}`) + uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":978,"timestamp":1234569600},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[]}]}`) }) } @@ -192,10 +192,10 @@ func testAfter50Blocks(t *testing.T) { t.Run("after 50 blocks", func(t *testing.T) { std.TestSkipHeights(50) lp01ExternalRewards := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":67,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":67,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) lp02ExternalRewards := ApiGetRewardsByLpTokenId(2) - uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":34654,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":34654,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) }) } @@ -233,10 +233,10 @@ func testMakePosition1OutRange(t *testing.T) { func testRewardNow(t *testing.T) { t.Run("check reward", func(t *testing.T) { lp01ExternalRewards := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":67,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":67,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) lp02ExternalRewards := ApiGetRewardsByLpTokenId(2) - uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":34654,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":34654,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) }) } @@ -245,17 +245,17 @@ func testRewardNowAfter1Block(t *testing.T) { std.TestSkipHeights(1) lp01ExternalRewards := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":1029,"timestamp":1234569702},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":67,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, lp01ExternalRewards, `{"stat":{"height":1029,"timestamp":1234569702},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":67,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) lp02ExternalRewards := ApiGetRewardsByLpTokenId(2) - uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":1029,"timestamp":1234569702},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":35348,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, lp02ExternalRewards, `{"stat":{"height":1029,"timestamp":1234569702},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":35348,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) }) // POSITION #1 PREVIOUS REWARD - // `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":67,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + // `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":67,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) // POSITION #2 PREVIOUS REWARD - // `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":34654,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + // `{"stat":{"height":1028,"timestamp":1234569700},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":34654,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) /* PREVIOUS REWARD -> NOW diff --git a/staker/tests/__TEST_staker_short_warmup_period_external_15_90d_test.gnoA b/staker/tests/__TEST_staker_short_warmup_period_external_15_90d_test.gnoA index 816390ead..097edb0c4 100644 --- a/staker/tests/__TEST_staker_short_warmup_period_external_15_90d_test.gnoA +++ b/staker/tests/__TEST_staker_short_warmup_period_external_15_90d_test.gnoA @@ -164,6 +164,6 @@ func test23HoursAfterActive(t *testing.T) { func testJustPrint(t *testing.T) { t.Run("check external", func(t *testing.T) { gpei := GetPrintExternalInfo() // EXTERNALs - uassert.Equal(t, gpei, `{"height":42378,"time":1234652400,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"50000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"1018880690769860308558949978600823","stakedOrExternalDuration":41400,"rewardPerBlock":"12860","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":72576579,"tokenAmountToGive":71945479,"full30":262958,"give30":78887,"full50":262958,"give50":131479,"full70":1051834,"give70":736284,"full100":70998829}]},{"lpTokenId":2,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"50000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"1018880690769860308558949978600823","stakedOrExternalDuration":41400,"rewardPerBlock":"12860","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":449197470,"tokenAmountToGive":445291404,"full30":1627527,"give30":488258,"full50":1627527,"give50":813763,"full70":6510108,"give70":4557075,"full100":439432308}]},{"lpTokenId":3,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"50000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"1018880690769860308558949978600823","stakedOrExternalDuration":41400,"rewardPerBlock":"12860","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":10596288,"tokenAmountToGive":10504146,"full30":38392,"give30":11517,"full50":38392,"give50":19196,"full70":153569,"give70":107498,"full100":10365935}]},{"lpTokenId":4,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"50000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"1018880690769860308558949978600823","stakedOrExternalDuration":41400,"rewardPerBlock":"12860","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":37062,"tokenAmountToGive":36740,"full30":134,"give30":40,"full50":134,"give50":67,"full70":537,"give70":376,"full100":36257}]}]}`) + uassert.Equal(t, gpei, `{"height":42378,"time":1234652400,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"50000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"1018880690769860308558949978600823","stakedOrExternalDuration":41400,"rewardPerBlock":"12860","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":72576579,"tokenAmountToGive":71945479,"full30":262958,"give30":78887,"full50":262958,"give50":131479,"full70":1051834,"give70":736284,"full100":70998829}]},{"lpTokenId":2,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"50000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"1018880690769860308558949978600823","stakedOrExternalDuration":41400,"rewardPerBlock":"12860","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":449197470,"tokenAmountToGive":445291404,"full30":1627527,"give30":488258,"full50":1627527,"give50":813763,"full70":6510108,"give70":4557075,"full100":439432308}]},{"lpTokenId":3,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"50000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"1018880690769860308558949978600823","stakedOrExternalDuration":41400,"rewardPerBlock":"12860","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":10596288,"tokenAmountToGive":10504146,"full30":38392,"give30":11517,"full50":38392,"give50":19196,"full70":153569,"give70":107498,"full100":10365935}]},{"lpTokenId":4,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"50000000000","startTimestamp":1234569600,"endTimestamp":1242345600,"rewardPerBlockX96":"1018880690769860308558949978600823","stakedOrExternalDuration":41400,"rewardPerBlock":"12860","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":37062,"tokenAmountToGive":36740,"full30":134,"give30":40,"full50":134,"give50":67,"full70":537,"give70":376,"full100":36257}]}]}`) }) } diff --git a/staker/tests/__TEST_staker_short_warmup_period_external_16_180d_test.gnoA b/staker/tests/__TEST_staker_short_warmup_period_external_16_180d_test.gnoA index a49049b2c..d1d195143 100644 --- a/staker/tests/__TEST_staker_short_warmup_period_external_16_180d_test.gnoA +++ b/staker/tests/__TEST_staker_short_warmup_period_external_16_180d_test.gnoA @@ -164,6 +164,6 @@ func test23HoursAfterActive(t *testing.T) { func testJustPrint(t *testing.T) { t.Run("check external", func(t *testing.T) { gpei := GetPrintExternalInfo() // EXTERNALs - uassert.Equal(t, gpei, `{"height":42378,"time":1234652400,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1250121600,"rewardPerBlockX96":"101888069076986030855894997860082304","stakedOrExternalDuration":41400,"rewardPerBlock":"1286008","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":7257658143,"tokenAmountToGive":7194548072,"full30":26295862,"give30":7888758,"full50":26295862,"give50":13147931,"full70":105183451,"give70":73628415,"full100":7099882968}]},{"lpTokenId":2,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1250121600,"rewardPerBlockX96":"101888069076986030855894997860082304","stakedOrExternalDuration":41400,"rewardPerBlock":"1286008","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":44919747124,"tokenAmountToGive":44529140629,"full30":162752706,"give30":48825812,"full50":162752706,"give50":81376353,"full70":651010827,"give70":455707579,"full100":43943230885}]},{"lpTokenId":3,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1250121600,"rewardPerBlockX96":"101888069076986030855894997860082304","stakedOrExternalDuration":41400,"rewardPerBlock":"1286008","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":1059629005,"tokenAmountToGive":1050414839,"full30":3839235,"give30":1151770,"full50":3839235,"give50":1919617,"full70":15356942,"give70":10749859,"full100":1036593593}]},{"lpTokenId":4,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1250121600,"rewardPerBlockX96":"101888069076986030855894997860082304","stakedOrExternalDuration":41400,"rewardPerBlock":"1286008","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":3706352,"tokenAmountToGive":3674123,"full30":13428,"give30":4028,"full50":13428,"give50":6714,"full70":53715,"give70":37600,"full100":3625781}]}]}`) + uassert.Equal(t, gpei, `{"height":42378,"time":1234652400,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1250121600,"rewardPerBlockX96":"101888069076986030855894997860082304","stakedOrExternalDuration":41400,"rewardPerBlock":"1286008","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":7257658143,"tokenAmountToGive":7194548072,"full30":26295862,"give30":7888758,"full50":26295862,"give50":13147931,"full70":105183451,"give70":73628415,"full100":7099882968}]},{"lpTokenId":2,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1250121600,"rewardPerBlockX96":"101888069076986030855894997860082304","stakedOrExternalDuration":41400,"rewardPerBlock":"1286008","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":44919747124,"tokenAmountToGive":44529140629,"full30":162752706,"give30":48825812,"full50":162752706,"give50":81376353,"full70":651010827,"give70":455707579,"full100":43943230885}]},{"lpTokenId":3,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1250121600,"rewardPerBlockX96":"101888069076986030855894997860082304","stakedOrExternalDuration":41400,"rewardPerBlock":"1286008","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":1059629005,"tokenAmountToGive":1050414839,"full30":3839235,"give30":1151770,"full50":3839235,"give50":1919617,"full70":15356942,"give70":10749859,"full100":1036593593}]},{"lpTokenId":4,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1250121600,"rewardPerBlockX96":"101888069076986030855894997860082304","stakedOrExternalDuration":41400,"rewardPerBlock":"1286008","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":3706352,"tokenAmountToGive":3674123,"full30":13428,"give30":4028,"full50":13428,"give50":6714,"full70":53715,"give70":37600,"full100":3625781}]}]}`) }) } diff --git a/staker/tests/__TEST_staker_short_warmup_period_external_17_365d_test.gnoA b/staker/tests/__TEST_staker_short_warmup_period_external_17_365d_test.gnoA index b51eeb907..b8fd1e661 100644 --- a/staker/tests/__TEST_staker_short_warmup_period_external_17_365d_test.gnoA +++ b/staker/tests/__TEST_staker_short_warmup_period_external_17_365d_test.gnoA @@ -165,6 +165,6 @@ func test23HoursAfterActive(t *testing.T) { func testJustPrint(t *testing.T) { t.Run("check external", func(t *testing.T) { gpei := GetPrintExternalInfo() // EXTERNALs - uassert.Equal(t, gpei, `{"height":42378,"time":1234652400,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1266105600,"rewardPerBlockX96":"50246171051664343983729040040588533","stakedOrExternalDuration":41400,"rewardPerBlock":"634195","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":3579119083,"tokenAmountToGive":3547996308,"full30":12967822,"give30":3890346,"full50":12967822,"give50":6483911,"full70":51871291,"give70":36309903,"full100":3501312148}]},{"lpTokenId":2,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1266105600,"rewardPerBlockX96":"50246171051664343983729040040588533","stakedOrExternalDuration":41400,"rewardPerBlock":"634195","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":22152204060,"tokenAmountToGive":21959576199,"full30":80261608,"give30":24078482,"full50":80261608,"give50":40130804,"full70":321046435,"give70":224732504,"full100":21670634409}]},{"lpTokenId":3,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1266105600,"rewardPerBlockX96":"50246171051664343983729040040588533","stakedOrExternalDuration":41400,"rewardPerBlock":"634195","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":522556768,"tokenAmountToGive":518012796,"full30":1893321,"give30":567996,"full50":1893321,"give50":946660,"full70":7573286,"give70":5301300,"full100":511196840}]},{"lpTokenId":4,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1266105600,"rewardPerBlockX96":"50246171051664343983729040040588533","stakedOrExternalDuration":41400,"rewardPerBlock":"634195","refundee":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","tokenAmountFull":1827789,"tokenAmountToGive":1811895,"full30":6622,"give30":1986,"full50":6622,"give50":3311,"full70":26489,"give70":18542,"full100":1788056}]}]}`) + uassert.Equal(t, gpei, `{"height":42378,"time":1234652400,"position":[{"lpTokenId":1,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1266105600,"rewardPerBlockX96":"50246171051664343983729040040588533","stakedOrExternalDuration":41400,"rewardPerBlock":"634195","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":3579119083,"tokenAmountToGive":3547996308,"full30":12967822,"give30":3890346,"full50":12967822,"give50":6483911,"full70":51871291,"give70":36309903,"full100":3501312148}]},{"lpTokenId":2,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1266105600,"rewardPerBlockX96":"50246171051664343983729040040588533","stakedOrExternalDuration":41400,"rewardPerBlock":"634195","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":22152204060,"tokenAmountToGive":21959576199,"full30":80261608,"give30":24078482,"full50":80261608,"give50":40130804,"full70":321046435,"give70":224732504,"full100":21670634409}]},{"lpTokenId":3,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1266105600,"rewardPerBlockX96":"50246171051664343983729040040588533","stakedOrExternalDuration":41400,"rewardPerBlock":"634195","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":522556768,"tokenAmountToGive":518012796,"full30":1893321,"give30":567996,"full50":1893321,"give50":946660,"full70":7573286,"give70":5301300,"full100":511196840}]},{"lpTokenId":4,"stakedHeight":126,"stakedTimestamp":1234567896,"incentive":[{"poolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/baz:3000","rewardToken":"gno.land/r/onbloc/qux","rewardAmount":"10000000000000","startTimestamp":1234569600,"endTimestamp":1266105600,"rewardPerBlockX96":"50246171051664343983729040040588533","stakedOrExternalDuration":41400,"rewardPerBlock":"634195","refundee":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","tokenAmountFull":1827789,"tokenAmountToGive":1811895,"full30":6622,"give30":1986,"full50":6622,"give50":3311,"full70":26489,"give70":18542,"full100":1788056}]}]}`) }) } diff --git a/staker/tests/__TEST_staker_short_warmup_period_internal_08_position_in_out_range_changed_by_swap_test.gnoA b/staker/tests/__TEST_staker_short_warmup_period_internal_08_position_in_out_range_changed_by_swap_test.gnoA index e1be75ec7..d8590140d 100644 --- a/staker/tests/__TEST_staker_short_warmup_period_internal_08_position_in_out_range_changed_by_swap_test.gnoA +++ b/staker/tests/__TEST_staker_short_warmup_period_internal_08_position_in_out_range_changed_by_swap_test.gnoA @@ -152,13 +152,13 @@ func testStakeToken_1_2(t *testing.T) { func testCurrentReward(t *testing.T) { t.Run("current reward", func(t *testing.T) { agr := ApiGetRewards() - uassert.Equal(t, agr, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":101175,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]},{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":3109440,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) + uassert.Equal(t, agr, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":101175,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]},{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":3109440,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) lpToken01Rewards := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, lpToken01Rewards, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":101175,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) + uassert.Equal(t, lpToken01Rewards, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":101175,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) lpToken02Rewards := ApiGetRewardsByLpTokenId(2) - uassert.Equal(t, lpToken02Rewards, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":3109440,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) + uassert.Equal(t, lpToken02Rewards, `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":3109440,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) }) } @@ -198,16 +198,16 @@ func testCheckRewardAfter1Block(t *testing.T) { // AT THIS POINT position #1 is out of range lpToken01Rewards := ApiGetRewardsByLpTokenId(1) - uassert.Equal(t, lpToken01Rewards, `{"stat":{"height":129,"timestamp":1234567902},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":101175,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) + uassert.Equal(t, lpToken01Rewards, `{"stat":{"height":129,"timestamp":1234567902},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":101175,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) lpToken02Rewards := ApiGetRewardsByLpTokenId(2) - uassert.Equal(t, lpToken02Rewards, `{"stat":{"height":129,"timestamp":1234567902},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":6320056,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) + uassert.Equal(t, lpToken02Rewards, `{"stat":{"height":129,"timestamp":1234567902},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":6320056,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) // POSITION #1 PREVIOUS REWARD - // `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":101175,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) + // `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":101175,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) // POSITION #2 PREVIOUS REWARD - // `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":3109440,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) + // `{"stat":{"height":128,"timestamp":1234567900},"response":[{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":3109440,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898}]}]}`) /* PREVIOUS REWARD -> NOW diff --git a/staker/tests/__TEST_staker_short_warmup_period_internal_external_91_test.gnoA b/staker/tests/__TEST_staker_short_warmup_period_internal_external_91_test.gnoA index 24f223960..63214991f 100644 --- a/staker/tests/__TEST_staker_short_warmup_period_internal_external_91_test.gnoA +++ b/staker/tests/__TEST_staker_short_warmup_period_internal_external_91_test.gnoA @@ -206,7 +206,7 @@ func testCheckCurrentReward(t *testing.T) { std.TestSkipHeights(199) // skip 1 + 199 = 200 more block agr := ApiGetRewards() - uassert.Equal(t, agr, `{"stat":{"height":1229,"timestamp":1234570102},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7028690,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":19,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7933895743,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":22085,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, agr, `{"stat":{"height":1229,"timestamp":1234570102},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7028690,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":19,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7933895743,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":22085,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) // check if position is in range poolCurrentTick := pl.PoolGetSlot0Tick("gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100") @@ -236,7 +236,7 @@ func testMakePositionOutRange(t *testing.T) { uassert.Equal(t, poolCurrentTick, int32(-62)) // pool's current tick is 0 agr := ApiGetRewards() - uassert.Equal(t, agr, `{"stat":{"height":1230,"timestamp":1234570104},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7028690,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":19,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7944597802,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":22200,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, agr, `{"stat":{"height":1230,"timestamp":1234570104},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7028690,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":19,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7944597802,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":22200,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) }) } @@ -247,7 +247,7 @@ func testCheckReward(t *testing.T) { // only position 2's reward should be increase // position 1 is out of range agr := ApiGetRewards() - uassert.Equal(t, agr, `{"stat":{"height":1330,"timestamp":1234570304},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7028690,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":19,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":9014803252,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":36180,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, agr, `{"stat":{"height":1330,"timestamp":1234570304},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7028690,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":19,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":9014803252,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":36180,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) }) } @@ -273,6 +273,6 @@ func testMakePositionInRange(t *testing.T) { uassert.Equal(t, poolCurrentTick, int32(0)) // pool's current tick is 0 agr := ApiGetRewards() - uassert.Equal(t, agr, `{"stat":{"height":1430,"timestamp":1234570504},"response":[{"lpTokenId":1,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7975952,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":31,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":10084061436,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":52369,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) + uassert.Equal(t, agr, `{"stat":{"height":1430,"timestamp":1234570504},"response":[{"lpTokenId":1,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":7975952,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":31,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]},{"lpTokenId":2,"address":"g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d","rewards":[{"incentiveType":"INTERNAL","incentiveId":"","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/gnoswap/v1/gns","rewardTokenAmount":10084061436,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234567898},{"incentiveType":"EXTERNAL","incentiveId":"ZzFsbXZycnJyNGVyMnVzODRoMjczMnNydTc2Yzl6bDJudmtuaGE4Yzpnbm8ubGFuZC9yL29uYmxvYy9iYXI6Z25vLmxhbmQvci9vbmJsb2MvcXV4OjEwMDpnbm8ubGFuZC9yL29uYmxvYy9iYXI6MTIzNDU2OTYwMDoxMjQyMzQ1NjAwOjEyNg==","targetPoolPath":"gno.land/r/onbloc/bar:gno.land/r/onbloc/qux:100","rewardTokenPath":"gno.land/r/onbloc/bar","rewardTokenAmount":52369,"stakeTimestamp":1234567898,"stakeHeight":127,"incentiveStart":1234569600}]}]}`) }) } diff --git a/staker/tests/__TEST_staker_warm_up_privileges_test.gnoA b/staker/tests/__TEST_staker_warm_up_privileges_test.gnoA index 1bc5c0f8e..edccb2f36 100644 --- a/staker/tests/__TEST_staker_warm_up_privileges_test.gnoA +++ b/staker/tests/__TEST_staker_warm_up_privileges_test.gnoA @@ -41,7 +41,7 @@ func TestSetWarmUp_NoPrivileges(t *testing.T) { uassert.PanicsWithMessage( t, - `[GNOSWAP-STAKER-001] caller has no permission || warm_up.gno__SetWarmUp() || only admin(g1lmvrrrr4er2us84h2732sru76c9zl2nvknha8c) or governance(g17s8w2ve7k85fwfnrk59lmlhthkjdted8whvqxd) can set warm up period, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, + `[GNOSWAP-STAKER-001] caller has no permission || warm_up.gno__SetWarmUp() || only admin(g17290cwvmrapvp869xfnhhawa8sm9edpufzat7d) or governance(g17s8w2ve7k85fwfnrk59lmlhthkjdted8whvqxd) can set warm up period, called from g1v36k6mteta047h6lta047h6lta047h6lz7gmv8`, func() { SetWarmUp(100, 100) },