Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Automatic update on Mon Jul 4 01:08:14 UTC 2022
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub committed Jul 4, 2022
1 parent 8f88432 commit 113a4f9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/cothority/calypso/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ func (c ContractWrite) Spawn(rst byzcoin.ReadOnlyStateTrie, inst byzcoin.Instruc
err = xerrors.Errorf("proof of write failed: %v", err)
return
}
var cid string
_, _, cid, _, err = rst.GetValues(c.Write.LTSID[:])
if err != nil {
err = xerrors.Errorf("couldn't find the corresponding LTSID: %v",
err)
return
}
if cid != ContractLongTermSecretID {
err = xerrors.Errorf("given LTSID points to wrong contract: %s",
cid)
return
}
instID, err := inst.DeriveIDArg("", "preID")
if err != nil {
return nil, nil, xerrors.Errorf(
Expand Down
2 changes: 2 additions & 0 deletions pkg/cothority/personhood/contracts/contract_spawner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ func TestContractSpawnerPreID(t *testing.T) {
testPreID(t, sr, instCred, ca, null, false)

ltsID := byzcoin.NewInstanceID(random.Bits(256, true, random.New()))
require.NoError(t, sr.CreateSCB(byzcoin.Create,
calypso.ContractLongTermSecretID, ltsID, nil, nil))
ltsKP := key.NewKeyPair(cothority.Suite)
wr := calypso.NewWrite(cothority.Suite, ltsID,
darc.ID{}, ltsKP.Public, []byte("key"))
Expand Down

0 comments on commit 113a4f9

Please sign in to comment.