-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basicchain: use UnitTestNet default config for generation #3696
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,18 +258,13 @@ func NewMultiWithOptionsNoCheck(t testing.TB, options *Options) (*core.Blockchai | |
options = &Options{} | ||
} | ||
|
||
cfg := config.Blockchain{ | ||
ProtocolConfiguration: config.ProtocolConfiguration{ | ||
Magic: netmode.UnitTestNet, | ||
MaxTraceableBlocks: MaxTraceableBlocks, | ||
TimePerBlock: TimePerBlock, | ||
StandbyCommittee: standByCommittee, | ||
ValidatorsCount: 4, | ||
VerifyTransactions: true, | ||
}, | ||
cfg, err := config.Load(config.DefaultConfigPath, netmode.UnitTestNet) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not clear from the commit message what is the reason of the problem and why does this change solve it. |
||
if err != nil { | ||
return nil, nil, nil, err | ||
} | ||
bcfg := cfg.Blockchain() | ||
if options.BlockchainConfigHook != nil { | ||
options.BlockchainConfigHook(&cfg) | ||
options.BlockchainConfigHook(&bcfg) | ||
} | ||
|
||
store := options.Store | ||
|
@@ -282,7 +277,7 @@ func NewMultiWithOptionsNoCheck(t testing.TB, options *Options) (*core.Blockchai | |
logger = zaptest.NewLogger(t) | ||
} | ||
|
||
bc, err := core.NewBlockchain(store, cfg, logger) | ||
bc, err := core.NewBlockchain(store, bcfg, logger) | ||
if err == nil && !options.SkipRun { | ||
go bc.Run() | ||
t.Cleanup(bc.Close) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,7 +121,7 @@ const ( | |
// not yet deployed to the testing basic chain. | ||
invokescriptContractAVM = "VwIADBQBDAMOBQYMDQIODw0DDgcJAAAAAErZMCQE2zBwaEH4J+yMqiYEEUAMFA0PAwIJAAIBAwcDBAUCAQAOBgwJStkwJATbMHFpQfgn7IyqJgQSQBNA" | ||
// block20StateRootLE is an LE stateroot of block #20 of basic testing chain. | ||
block20StateRootLE = "394e20adf99a6ba160df7351770dfb193ee8af174b7b3ed45f4e2ae8c43694e8" | ||
block20StateRootLE = "c6d742ddd1db4e966a03d02d7d3d08364cff2406c150e1cdf561c64774ed7612" | ||
) | ||
|
||
var ( | ||
|
@@ -1354,22 +1354,22 @@ var rpcTestCases = map[string][]rpcTestCase{ | |
return &[]result.Validator{} | ||
}, | ||
/* preview3 doesn't return any validators until there is a vote | ||
check: func(t *testing.T, e *executor, validators any) { | ||
var expected []result.Validator | ||
sBValidators := e.chain.GetStandByValidators() | ||
for _, sbValidator := range sBValidators { | ||
expected = append(expected, result.Validator{ | ||
PublicKey: *sbValidator, | ||
Votes: 0, | ||
Active: true, | ||
}) | ||
} | ||
|
||
actual, ok := validators.(*[]result.Validator) | ||
require.True(t, ok) | ||
|
||
assert.ElementsMatch(t, expected, *actual) | ||
}, | ||
check: func(t *testing.T, e *executor, validators any) { | ||
var expected []result.Validator | ||
sBValidators := e.chain.GetStandByValidators() | ||
for _, sbValidator := range sBValidators { | ||
expected = append(expected, result.Validator{ | ||
PublicKey: *sbValidator, | ||
Votes: 0, | ||
Active: true, | ||
}) | ||
} | ||
|
||
actual, ok := validators.(*[]result.Validator) | ||
require.True(t, ok) | ||
|
||
assert.ElementsMatch(t, expected, *actual) | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Useless change. And BTW, create an issue to enable this test, preview3 has passed long ago. |
||
*/ | ||
}, | ||
}, | ||
|
@@ -1456,7 +1456,7 @@ var rpcTestCases = map[string][]rpcTestCase{ | |
chg := []dboper.Operation{{ | ||
State: "Changed", | ||
Key: []byte{0xfa, 0xff, 0xff, 0xff, 0xb}, | ||
Value: []byte{0xba, 0xaa, 0x3d, 0x19, 0x5e, 0x79, 0x12}, | ||
Value: []byte{0xba, 0x8c, 0x97, 0x19, 0x5e, 0x79, 0x12}, | ||
}, { | ||
State: "Added", | ||
Key: []byte{0xfb, 0xff, 0xff, 0xff, 0x14, 0xd6, 0x24, 0x87, 0x12, 0xff, 0x97, 0x22, 0x80, 0xa0, 0xae, 0xf5, 0x24, 0x1c, 0x96, 0x4d, 0x63, 0x78, 0x29, 0xcd, 0xb}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AnnaShaleva it could be correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's because you changed the node's fork scheduler.