(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestWritePrivateStateRoot(t *testing.T) { |
| 77 | db := database.NewMemDatabase() |
| 78 | blockRoot := common.BytesToHash([]byte{1, 2, 3, 4, 5, 6, 7, 8}) |
| 79 | privateRoot := common.BytesToHash([]byte{1, 2, 3, 4, 5, 6, 7, 8}) |
| 80 | |
| 81 | type args struct { |
| 82 | db database.Database |
| 83 | blockRoot common.Hash |
| 84 | root common.Hash |
| 85 | } |
| 86 | tests := []struct { |
| 87 | name string |
| 88 | args args |
| 89 | wantErr bool |
| 90 | }{ |
| 91 | { |
| 92 | name: "Positive Case: write a private state root", |
| 93 | args: args{ |
| 94 | db: db, |
| 95 | blockRoot: blockRoot, |
| 96 | root: privateRoot, |
| 97 | }, |
| 98 | wantErr: false, |
| 99 | }, |
| 100 | } |
| 101 | for _, tt := range tests { |
| 102 | t.Run(tt.name, func(t *testing.T) { |
| 103 | if err := WritePrivateStateRoot(tt.args.db, tt.args.blockRoot, tt.args.root); (err != nil) != tt.wantErr { |
| 104 | t.Errorf("WritePrivateStateRoot() error = %v, wantErr %v", err, tt.wantErr) |
| 105 | } |
| 106 | }) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func TestWritePrivateReceipt(t *testing.T) { |
| 111 | type args struct { |
nothing calls this directly
no test coverage detected