Skip to content

Commit

Permalink
Proposal signing working
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwstein committed Sep 9, 2024
1 parent bdef10f commit a5c48c3
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions integration-tests/deployment/ccip/add_chain_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ccipdeployment

import (
"encoding/json"
"testing"

"github.com/ethereum/go-ethereum/crypto"
Expand Down Expand Up @@ -52,22 +51,21 @@ func TestAddChain(t *testing.T) {
// Enable inbound to new 4th chain.
proposals, ab, err := NewChainInbound(e.Env, e.Ab, e.HomeChainSel, newChain, initialDeploy)
require.NoError(t, err)
require.Equal(t, 3, len(proposals[0].ChainMetadata))
//require.Equal(t, 3, len(proposals[0].ChainMetadata))
// Sign this proposal with the deployer key.
executor, err := proposals[0].ToExecutor(executorClients)
realProposal, err := proposals[0].ToMCMSOnlyProposal()
require.NoError(t, err)

executor, err := realProposal.ToExecutor(executorClients)
payload, err := executor.SigningHash()
require.NoError(t, err)
// Sign the payload
sig, err := crypto.Sign(payload.Bytes(), TestXXXMCMSSigner)
require.NoError(t, err)

mcmSig, err := mcms.NewSignatureFromBytes(sig)
// Sign the payload
unmarshalledSig := mcms.Signature{}
err = json.Unmarshal(sig, &unmarshalledSig)
require.NoError(t, err)

// Add signature to proposal
proposals[0].Signatures = append(proposals[0].Signatures, unmarshalledSig)
proposals[0].Signatures = append(proposals[0].Signatures, mcmSig)
require.NoError(t, proposals[0].Validate())

t.Log(proposals, ab)
Expand Down

0 comments on commit a5c48c3

Please sign in to comment.