Skip to content

Commit

Permalink
sidechain/deploy: Fix Notary role designation for single node
Browse files Browse the repository at this point in the history
Despite the fact that the committee consists of one member, the
transaction must be witnessed by a multi-sig 1:1 account.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Aug 28, 2023
1 parent 5a868ca commit 13e19c4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/morph/deploy/notary.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,15 @@ func enableNotary(ctx context.Context, prm enableNotaryPrm) error {
// initDesignateNotaryRoleToLocalAccountTick returns a function that preserves
// context of the Notary role designation to the local account between calls.
func initDesignateNotaryRoleToLocalAccountTick(ctx context.Context, prm enableNotaryPrm) (func(), error) {
localActor, err := actor.NewSimple(prm.blockchain, prm.localAcc)
committeeMultiSigM := smartcontract.GetMajorityHonestNodeCount(len(prm.committee))
committeeMultiSigAcc := wallet.NewAccountFromPrivateKey(prm.localAcc.PrivateKey())

err := committeeMultiSigAcc.ConvertMultisig(committeeMultiSigM, prm.committee)
if err != nil {
return nil, fmt.Errorf("compose committee multi-signature account: %w", err)
}

localActor, err := actor.NewSimple(prm.blockchain, committeeMultiSigAcc)
if err != nil {
return nil, fmt.Errorf("init transaction sender from local account: %w", err)
}
Expand Down

0 comments on commit 13e19c4

Please sign in to comment.