@@ -55,7 +55,7 @@ const byronGenesisConfig = `
55
55
"updateProposalThd": "100000000000000",
56
56
"updateVoteThd": "1000000000000"
57
57
},
58
- "ftsSeed": "76617361206f7061736120736b6f766f726f64612047677572646120626f726f64612070726f766f6461",
58
+ "ftsSeed": "76617361206f7061736120736b6f766f726f64612047677572646120626f726f64612070726f766f6461",
59
59
"protocolConsts": {
60
60
"k": 2160,
61
61
"protocolMagic": 764824073,
@@ -128,7 +128,10 @@ var expectedGenesisObj = byron.ByronGenesis{
128
128
UpdateProposalThd : 100000000000000 ,
129
129
UpdateVoteThd : 1000000000000 ,
130
130
},
131
- FtsSeed : "76617361206f7061736120736b6f766f726f64612047677572646120626f726f64612070726f766f6461" ,
131
+ FtsSeed : byron.ByronGenesisFtsSeed {
132
+ Value : "76617361206f7061736120736b6f766f726f64612047677572646120626f726f64612070726f766f6461" ,
133
+ IsObject : false ,
134
+ },
132
135
ProtocolConsts : byron.ByronGenesisProtocolConsts {
133
136
K : 2160 ,
134
137
ProtocolMagic : 764824073 ,
@@ -431,3 +434,65 @@ func TestNewByronGenesisFromReader(t *testing.T) {
431
434
)
432
435
}
433
436
}
437
+
438
+ func TestGenesis_FtsSeed_EmptyObject (t * testing.T ) {
439
+ jsonData := `{
440
+ "avvmDistr": { "addr1": "1000" },
441
+ "blockVersionData": {
442
+ "heavyDelThd": "1",
443
+ "maxBlockSize": "2",
444
+ "maxHeaderSize": "3",
445
+ "maxProposalSize": "4",
446
+ "maxTxSize": "5",
447
+ "mpcThd": "6",
448
+ "scriptVersion": 1,
449
+ "slotDuration": "7",
450
+ "softforkRule": {
451
+ "initThd": "8",
452
+ "minThd": "9",
453
+ "thdDecrement": "10"
454
+ },
455
+ "txFeePolicy": {
456
+ "multiplier": "11",
457
+ "summand": "12"
458
+ },
459
+ "unlockStakeEpoch": "13",
460
+ "updateImplicit": "14",
461
+ "updateProposalThd": "15",
462
+ "updateVoteThd": "16"
463
+ },
464
+ "ftsSeed": {},
465
+ "protocolConsts": {
466
+ "k": 1,
467
+ "protocolMagic": 42,
468
+ "vssMinTtl": 2,
469
+ "vssMaxTtl": 10
470
+ },
471
+ "startTime": 100000,
472
+ "bootStakeholders": { "stakeholder1": 1 },
473
+ "heavyDelegation": {
474
+ "key1": {
475
+ "cert": "cert-val",
476
+ "delegatePk": "delegate-pk",
477
+ "issuerPk": "issuer-pk",
478
+ "omega": 5
479
+ }
480
+ },
481
+ "nonAvvmBalances": { "addr2": "2000" },
482
+ "vssCerts": {
483
+ "cert1": {
484
+ "expiryEpoch": 5,
485
+ "signature": "sig",
486
+ "signingKey": "sign-key",
487
+ "vssKey": "vss-key"
488
+ }
489
+ }
490
+ }`
491
+ got , err := byron .NewByronGenesisFromReader (strings .NewReader (jsonData ))
492
+ if err != nil {
493
+ t .Fatalf ("unexpected error: %v" , err )
494
+ }
495
+ if got .FtsSeed .Value != "" || ! got .FtsSeed .IsObject {
496
+ t .Fatalf ("ftsSeed not parsed as empty object; got=%#v" , got .FtsSeed )
497
+ }
498
+ }
0 commit comments