Skip to content

Multisig keys have 32-byte addresses #3102

@alessio

Description

@alessio

Patch to reproduce it:

--- a/crypto/multisig/threshold_pubkey_test.go
+++ b/crypto/multisig/threshold_pubkey_test.go
@@ -94,6 +94,12 @@ func TestMultiSigPubKeyEquality(t *testing.T) {
        multisigKey2 := NewPubKeyMultisigThreshold(2, pubkeysCpy)
        require.False(t, multisigKey.Equals(multisigKey2))
 }
+func TestAddress(t *testing.T) {
+       msg := []byte{1, 2, 3, 4}
+       pubkeys, _ := generatePubKeysAndSignatures(5, msg)
+       multisigKey := NewPubKeyMultisigThreshold(2, pubkeys)
+       require.Len(t, multisigKey.Address().Bytes(), 20)
+}
 
 func generatePubKeysAndSignatures(n int, msg []byte) (pubkeys []crypto.PubKey, signatures [][]byte) {
        pubkeys = make([]crypto.PubKey, n)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions