diff options
author | Amine <hilalyamine@gmail.com> | 2019-08-13 16:47:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-13 16:47:24 +0200 |
commit | cf960bc7a5bd0b7af28d35de33131fb0b5ce5253 (patch) | |
tree | 5df133c91bb4e1ccc5f9fbeb4664416b93d23bf5 /bug/operation_pack_test.go | |
parent | 146894a5657d3b20dbaf769a950b12bd19df499c (diff) | |
parent | c809d37152ea87a66fc281730042dcb4299a8263 (diff) | |
download | git-bug-cf960bc7a5bd0b7af28d35de33131fb0b5ce5253.tar.gz |
Merge pull request #193 from MichaelMure/immutableID
Future proof the operation's ID
Diffstat (limited to 'bug/operation_pack_test.go')
-rw-r--r-- | bug/operation_pack_test.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bug/operation_pack_test.go b/bug/operation_pack_test.go index 09d159af..21ac0a00 100644 --- a/bug/operation_pack_test.go +++ b/bug/operation_pack_test.go @@ -48,14 +48,16 @@ func TestOperationPackSerialize(t *testing.T) { err = json.Unmarshal(data, &opp2) assert.NoError(t, err) - ensureHash(t, opp) + ensureIDs(t, opp) assert.Equal(t, opp, opp2) } -func ensureHash(t *testing.T, opp *OperationPack) { +func ensureIDs(t *testing.T, opp *OperationPack) { for _, op := range opp.Operations { - _, err := op.Hash() - require.NoError(t, err) + id := op.Id() + require.NoError(t, id.Validate()) + id = op.GetAuthor().Id() + require.NoError(t, id.Validate()) } } |