(t *testing.T)
| 545 | } |
| 546 | |
| 547 | func TestValidateGenesisState(t *testing.T) { |
| 548 | tests := []struct { |
| 549 | name string |
| 550 | detail string |
| 551 | input *GenesisState |
| 552 | error string |
| 553 | }{ |
| 554 | { |
| 555 | name: "bad validator address", |
| 556 | detail: "the validator address length is invalid", |
| 557 | input: &GenesisState{ |
| 558 | Validators: []*Validator{ |
| 559 | { |
| 560 | Address: nil, |
| 561 | PublicKey: newTestPublicKeyBytes(t), |
| 562 | StakedAmount: 100, |
| 563 | }, |
| 564 | }, |
| 565 | Params: DefaultParams(), |
| 566 | }, |
| 567 | error: "address size is invalid", |
| 568 | }, |
| 569 | { |
| 570 | name: "bad validator public key", |
| 571 | detail: "the validator public key length is invalid", |
| 572 | input: &GenesisState{ |
| 573 | Validators: []*Validator{ |
| 574 | { |
| 575 | Address: newTestAddressBytes(t), |
| 576 | PublicKey: newTestAddressBytes(t), |
| 577 | StakedAmount: 100, |
| 578 | }, |
| 579 | }, |
| 580 | Params: DefaultParams(), |
| 581 | }, |
| 582 | error: "public key size is invalid", |
| 583 | }, |
| 584 | { |
| 585 | name: "bad validator output address", |
| 586 | detail: "the validator output address length is invalid", |
| 587 | input: &GenesisState{ |
| 588 | Validators: []*Validator{ |
| 589 | { |
| 590 | Address: newTestAddressBytes(t), |
| 591 | PublicKey: newTestPublicKeyBytes(t), |
| 592 | StakedAmount: 100, |
| 593 | Output: newTestPublicKeyBytes(t), |
| 594 | }, |
| 595 | }, |
| 596 | Params: DefaultParams(), |
| 597 | }, |
| 598 | error: "address size is invalid", |
| 599 | }, |
| 600 | { |
| 601 | name: "account address", |
| 602 | detail: "the account address length is invalid", |
| 603 | input: &GenesisState{ |
| 604 | Accounts: []*Account{ |
nothing calls this directly
no test coverage detected