@@ -20,8 +20,11 @@ import (
2020)
2121
2222const (
23- nestedLeafImageHashPrefix = "Sequence nested config:\n "
24- subdigestLeafImageHashPrefix = "Sequence static digest:\n "
23+ addressLeafImageHashPrefix = "Sequence signer:\n "
24+ nestedLeafImageHashPrefix = "Sequence nested config:\n "
25+ sapientLeafImageHashPrefix = "Sequence sapient config:\n "
26+ subdigestLeafImageHashPrefix = "Sequence static digest:\n "
27+ anyAddressSubdigestLeafImageHashPrefix = "Sequence any address subdigest:\n "
2528)
2629
2730var Core core.Core [* WalletConfig , core.Signature [* WalletConfig ]] = v3Core {}
@@ -1553,7 +1556,7 @@ func (l *signatureTreeAnyAddressSubdigestLeaf) join(other signatureTree) (signat
15531556
15541557func (l * signatureTreeAnyAddressSubdigestLeaf ) reduceImageHash () (core.ImageHash , error ) {
15551558 return core.ImageHash {Hash : crypto .Keccak256Hash (
1556- []byte ("Sequence any address subdigest: \n " ),
1559+ []byte (anyAddressSubdigestLeafImageHashPrefix ),
15571560 l .Subdigest .Bytes (),
15581561 )}, nil
15591562}
@@ -2195,7 +2198,7 @@ func (l *WalletConfigTreeAddressLeaf) ImageHash() core.ImageHash {
21952198 weight .FillBytes (weightBytes )
21962199
21972200 hash := crypto .Keccak256Hash (
2198- []byte ("Sequence signer: \n " ),
2201+ []byte (addressLeafImageHashPrefix ),
21992202 l .Address .Bytes (),
22002203 weightBytes ,
22012204 )
@@ -2510,7 +2513,7 @@ func (l *WalletConfigTreeSapientSignerLeaf) ImageHash() core.ImageHash {
25102513 weight .FillBytes (weightBytes )
25112514
25122515 hash := crypto .Keccak256Hash (
2513- []byte ("Sequence sapient config: \n " ),
2516+ []byte (sapientLeafImageHashPrefix ),
25142517 l .Address .Bytes (),
25152518 weightBytes ,
25162519 l .ImageHash_ .Bytes (),
@@ -2588,7 +2591,7 @@ func decodeWalletConfigTreeAnyAddressSubdigestLeaf(object any) (WalletConfigTree
25882591
25892592func (l WalletConfigTreeAnyAddressSubdigestLeaf ) ImageHash () core.ImageHash {
25902593 hash := crypto .Keccak256Hash (
2591- []byte ("Sequence any address subdigest: \n " ),
2594+ []byte (anyAddressSubdigestLeafImageHashPrefix ),
25922595 l .Digest .Bytes (),
25932596 )
25942597 return core.ImageHash {
@@ -2656,12 +2659,6 @@ func minBytesForUint16(value uint16) byte {
26562659 }
26572660 return 2
26582661}
2659- func minWeightBytes (weight uint64 ) uint8 {
2660- if weight <= 3 {
2661- return 0
2662- }
2663- return minBytesFor (weight )
2664- }
26652662
26662663func bitsFor (val uint64 ) int {
26672664 if val == 0 {
0 commit comments