Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Adjust code for updated rent structure. #243

Merged
merged 4 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/iotaledger/hive.go/stringify v0.0.0-20230803080824-b9183942b168
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230801163503-b55ade45411b
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230801163327-a72de1469de7
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b
github.com/labstack/echo/v4 v4.11.1
github.com/libp2p/go-libp2p v0.29.0
github.com/multiformats/go-multiaddr v0.10.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230801163503-b55ade45411b h1:MeK4C
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230801163503-b55ade45411b/go.mod h1:zoeXg8m9SfQTQY/2713pkocWg0Fi8U5fnoffcqar2J8=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230801163327-a72de1469de7 h1:AN2pAMyIhsfxMUWm3GX/FgastZFP5Q7lzfYboURzgus=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230801163327-a72de1469de7/go.mod h1:Dg0D7hAtieN4EUc7duZk6iWSikv5egQisl/XXY7zRBI=
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8 h1:ggLlxvd95Nto1G/djk+KQmPP0Gwj9W9U+OLo8iiVPXk=
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8/go.mod h1:BGmYQp0ZX6OidxsNzH+GbwF2oc4wbsCSNHVnt0P+vl0=
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b h1:gcDhylaGePNOgRkT8URD87rm6wAZeeUPTYQO3R+floE=
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b/go.mod h1:BGmYQp0ZX6OidxsNzH+GbwF2oc4wbsCSNHVnt0P+vl0=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk=
Expand Down
10 changes: 5 additions & 5 deletions pkg/tests/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ func Test_TransitionAccount(t *testing.T) {
// Nil address will be replaced with the address generated from genesis seed.
// A single key may unlock multiple accounts; that's why it can't be used as a source for AccountID derivation.
Address: nil,
// Set 3 time min amount to cover the rent. If it's too little, then the snapshot creation will fail.
// We need more to cover an additional key that is added in the test.
Amount: testsuite.MinIssuerAccountAmount * 3,
// Set an amount enough to cover the rent and to cover an additional key that is added in the test.
// If it's too little, then the test will fail.
Amount: testsuite.MinIssuerAccountAmount * 10,
Mana: 0,
// AccountID is derived from this field, so this must be set uniquely for each account.
IssuerKey: oldGenesisOutputKey,
Expand Down Expand Up @@ -236,7 +236,7 @@ func Test_TransitionAccount(t *testing.T) {
ValidatorStakeChange: 0,
StakeEndEpochChange: 0,
FixedCostChange: 0,
DelegationStakeChange: 1914080,
DelegationStakeChange: 973040,
}, false, ts.Nodes()...)

ts.AssertAccountData(&accounts.AccountData{
Expand All @@ -247,7 +247,7 @@ func Test_TransitionAccount(t *testing.T) {
PubKeys: ds.NewSet(newAccountBlockIssuerKey),
StakeEndEpoch: 10,
FixedCost: 421,
DelegationStake: 1966240,
DelegationStake: 973040,
ValidatorStake: 10000,
}, ts.Nodes()...)

Expand Down
6 changes: 4 additions & 2 deletions pkg/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import (
"github.com/iotaledger/iota.go/v4/tpkg"
)

const MinIssuerAccountAmount = iotago.BaseToken(84400)
const MinValidatorAccountAmount = iotago.BaseToken(88200)
const MinIssuerAccountAmount = iotago.BaseToken(372900)
const MinValidatorAccountAmount = iotago.BaseToken(702900)

type TestSuite struct {
Testing *testing.T
Expand Down Expand Up @@ -96,6 +96,8 @@ func NewTestSuite(testingT *testing.T, opts ...options.Option[TestSuite]) *TestS
100,
1,
10,
100,
100,
),
iotago.WithTimeProviderOptions(
time.Now().Truncate(10*time.Second).Unix()-t.optsGenesisTimestampOffset,
Expand Down
2 changes: 1 addition & 1 deletion tools/evil-spammer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/iotaledger/hive.go/runtime v0.0.0-20230803080824-b9183942b168
github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000
github.com/iotaledger/iota-core/tools/genesis-snapshot v0.0.0-00010101000000-000000000000
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b
github.com/mr-tron/base58 v1.2.0
go.uber.org/atomic v1.11.0
)
Expand Down
4 changes: 2 additions & 2 deletions tools/evil-spammer/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230803080824-b918394
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230803080824-b9183942b168/go.mod h1:sCLs3xrJRKcru6UE1WnlvQw8bib74yy2A7s+caMtoZY=
github.com/iotaledger/hive.go/stringify v0.0.0-20230803080824-b9183942b168 h1:OpD3/NapP84/dDj/5gpvD/Mrf9hTTnd5XyKWR6wBBkk=
github.com/iotaledger/hive.go/stringify v0.0.0-20230803080824-b9183942b168/go.mod h1:l/F3cA/+67QdNj+sohv2v4HhmsdOcWScoA+sVYoAE4c=
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8 h1:ggLlxvd95Nto1G/djk+KQmPP0Gwj9W9U+OLo8iiVPXk=
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8/go.mod h1:BGmYQp0ZX6OidxsNzH+GbwF2oc4wbsCSNHVnt0P+vl0=
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b h1:gcDhylaGePNOgRkT8URD87rm6wAZeeUPTYQO3R+floE=
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b/go.mod h1:BGmYQp0ZX6OidxsNzH+GbwF2oc4wbsCSNHVnt0P+vl0=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
Expand Down
2 changes: 1 addition & 1 deletion tools/gendoc/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ require (
github.com/iotaledger/hive.go/stringify v0.0.0-20230803080824-b9183942b168 // indirect
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230801163503-b55ade45411b // indirect
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230801163327-a72de1469de7 // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8 // indirect
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions tools/gendoc/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230801163503-b55ade45411b h1:MeK4C
github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230801163503-b55ade45411b/go.mod h1:zoeXg8m9SfQTQY/2713pkocWg0Fi8U5fnoffcqar2J8=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230801163327-a72de1469de7 h1:AN2pAMyIhsfxMUWm3GX/FgastZFP5Q7lzfYboURzgus=
github.com/iotaledger/inx/go v1.0.0-rc.2.0.20230801163327-a72de1469de7/go.mod h1:Dg0D7hAtieN4EUc7duZk6iWSikv5egQisl/XXY7zRBI=
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8 h1:ggLlxvd95Nto1G/djk+KQmPP0Gwj9W9U+OLo8iiVPXk=
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8/go.mod h1:BGmYQp0ZX6OidxsNzH+GbwF2oc4wbsCSNHVnt0P+vl0=
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b h1:gcDhylaGePNOgRkT8URD87rm6wAZeeUPTYQO3R+floE=
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b/go.mod h1:BGmYQp0ZX6OidxsNzH+GbwF2oc4wbsCSNHVnt0P+vl0=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk=
Expand Down
2 changes: 1 addition & 1 deletion tools/genesis-snapshot/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/iotaledger/hive.go/lo v0.0.0-20230803080824-b9183942b168
github.com/iotaledger/hive.go/runtime v0.0.0-20230803080824-b9183942b168
github.com/iotaledger/iota-core v0.0.0-00010101000000-000000000000
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b
github.com/mr-tron/base58 v1.2.0
github.com/spf13/pflag v1.0.5
golang.org/x/crypto v0.11.0
Expand Down
4 changes: 2 additions & 2 deletions tools/genesis-snapshot/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230803080824-b918394
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230803080824-b9183942b168/go.mod h1:sCLs3xrJRKcru6UE1WnlvQw8bib74yy2A7s+caMtoZY=
github.com/iotaledger/hive.go/stringify v0.0.0-20230803080824-b9183942b168 h1:OpD3/NapP84/dDj/5gpvD/Mrf9hTTnd5XyKWR6wBBkk=
github.com/iotaledger/hive.go/stringify v0.0.0-20230803080824-b9183942b168/go.mod h1:l/F3cA/+67QdNj+sohv2v4HhmsdOcWScoA+sVYoAE4c=
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8 h1:ggLlxvd95Nto1G/djk+KQmPP0Gwj9W9U+OLo8iiVPXk=
github.com/iotaledger/iota.go/v4 v4.0.0-20230802140830-5a196b94e5f8/go.mod h1:BGmYQp0ZX6OidxsNzH+GbwF2oc4wbsCSNHVnt0P+vl0=
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b h1:gcDhylaGePNOgRkT8URD87rm6wAZeeUPTYQO3R+floE=
github.com/iotaledger/iota.go/v4 v4.0.0-20230804061106-7e29753c193b/go.mod h1:BGmYQp0ZX6OidxsNzH+GbwF2oc4wbsCSNHVnt0P+vl0=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
Expand Down
6 changes: 3 additions & 3 deletions tools/genesis-snapshot/presets/presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var Base = []options.Option[snapshotcreator.Options]{
snapshotcreator.WithProtocolParameters(
iotago.NewV3ProtocolParameters(
iotago.WithNetworkOptions("default", "rms"),
iotago.WithSupplyOptions(10_000_000_000, 100, 1, 10),
iotago.WithSupplyOptions(10_000_000_000, 100, 1, 10, 100, 100),
iotago.WithTimeProviderOptions(time.Now().Unix(), 10, 13),
iotago.WithLivenessOptions(5, 10, 20, 30),
),
Expand Down Expand Up @@ -93,7 +93,7 @@ var Docker = []options.Option[snapshotcreator.Options]{
snapshotcreator.WithProtocolParameters(
iotago.NewV3ProtocolParameters(
iotago.WithNetworkOptions("docker", "rms"),
iotago.WithSupplyOptions(10_000_000_000, 1, 1, 10),
iotago.WithSupplyOptions(10_000_000_000, 1, 1, 10, 100, 100),
iotago.WithTimeProviderOptions(time.Now().Unix(), 10, 13),
iotago.WithLivenessOptions(5, 10, 20, 30),
),
Expand Down Expand Up @@ -144,7 +144,7 @@ var Feature = []options.Option[snapshotcreator.Options]{
snapshotcreator.WithProtocolParameters(
iotago.NewV3ProtocolParameters(
iotago.WithNetworkOptions("feature", "rms"),
iotago.WithSupplyOptions(10_000_000_000, 100, 1, 10),
iotago.WithSupplyOptions(10_000_000_000, 100, 1, 10, 100, 100),
iotago.WithTimeProviderOptions(1689848996, 10, 13),
iotago.WithLivenessOptions(5, 10, 20, 30),
),
Expand Down