Skip to content

Commit

Permalink
Merge pull request #64 from ironbeer/feat/shorten-testnet
Browse files Browse the repository at this point in the history
Configured block time shortening epoch for the testnet
  • Loading branch information
ironbeer authored Aug 26, 2024
2 parents b0f344d + 7f0f5a3 commit f30864e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/oasys/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var deploymentSets = map[common.Hash]map[uint64]deploymentSet{
955400: deploymentSet{deployments7, deployments8},
1519840: deploymentSet{deployments9},
1880660: deploymentSet{deployments10},
9999999: deploymentSet{deployments11}, // TODO
4017600: deploymentSet{deployments11},
},
defaultGenesisHash: {
2: deploymentSet{
Expand Down
21 changes: 19 additions & 2 deletions contracts/oasys/oasys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ func _deployments11(genesisHash common.Hash, contracts wantContracts) {
}

switch genesisHash {
case params.OasysMainnetGenesisHash, params.OasysTestnetGenesisHash:
case params.OasysMainnetGenesisHash:
contracts["0x0000000000000000000000000000000000001000"].storage = map[string]string{
// uint256[] public updates
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000000002",
Expand All @@ -1076,6 +1076,23 @@ func _deployments11(genesisHash common.Hash, contracts wantContracts) {
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ade": "0x00000000000000000000000000000000000000000000000000000000000001f4",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5adf": "0x0000000000000000000000000000000000000000000000000000000000000002",
}
case params.OasysTestnetGenesisHash:
contracts["0x0000000000000000000000000000000000001000"].storage = map[string]string{
// uint256[] public updates
"0x0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000000002",
"0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7": "0x00000000000000000000000000000000000000000000000000000000000002bb",
// EnvironmentValue[] public values
"0x0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000000002",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad7": "0x00000000000000000000000000000000000000000000000000000000003d5900",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad8": "0x00000000000000000000000000000000000000000000000000000000000002bb",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad9": "0x0000000000000000000000000000000000000000000000000000000000000006",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ada": "0x0000000000000000000000000000000000000000000000000000000000003840",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5adb": "0x000000000000000000000000000000000000000000000000000000000000000a",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5adc": "0x000000000000000000000000000000000000000000000000000000000000000a",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5add": "0x000000000000000000000000000000000000000000084595161401484a000000",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ade": "0x00000000000000000000000000000000000000000000000000000000000001f4",
"0x405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5adf": "0x0000000000000000000000000000000000000000000000000000000000000002",
}
default:
contracts["0x0000000000000000000000000000000000001000"].storage = map[string]string{
// uint256[] public updates
Expand Down Expand Up @@ -1142,7 +1159,7 @@ func TestDeploy(t *testing.T) {
{955400, []deployFn{_deployments7, _deployments8}},
{1519840, []deployFn{_deployments9}},
{1880660, []deployFn{_deployments10}},
{9999999, []deployFn{_deployments11}},
{4017600, []deployFn{_deployments11}},
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions params/oasys.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const (
SHORT_BLOCK_TIME_EPOCH_PERIOD = 14400 // 6 sec * 14400 block = 1 days

SHORT_BLOCK_TIME_FORK_EPOCH_MAINNET = 999 // TODO
SHORT_BLOCK_TIME_FORK_EPOCH_TESTNET = 999 // TODO
SHORT_BLOCK_TIME_FORK_EPOCH_OTHERS = 10 // for local chain
SHORT_BLOCK_TIME_FORK_EPOCH_TESTNET = 699
SHORT_BLOCK_TIME_FORK_EPOCH_OTHERS = 10 // for local chain
)

// EnvironmentValue is a representation of `Environment.EnvironmentValue`.
Expand Down

0 comments on commit f30864e

Please sign in to comment.