Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@

## API Breaking changes in go-sequence

### `sequence.DecodeExecdata()`

```diff
-func DecodeExecdata(data []byte) (Transactions, *big.Int, []byte, error)
+func DecodeRawTransactions(data []byte) (Transactions, error)
```

```diff
-sequenceTransactions, _, _, err := sequence.DecodeExecdata(data)
+ sequenceTransactions, err := sequence.DecodeRawTransactions(data)
```
Comment on lines +10 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't remove DecodeExecdata, it does something different from DecodeRawTransactions.


### `sequence.AddressFromImageHash()`

```diff
- address, err := sequence.AddressFromImageHash(imageHash.String(), seqContext)
+ address, err := sequence.AddressFromImageHash(imageHash, seqContext)
```

### `sequence.Relayer` interface

```diff
Expand Down Expand Up @@ -52,3 +71,87 @@
// ...
}
```

### `core`

```diff
type SignerSignature struct {
Signer common.Address
- Subdigest Subdigest
Type SignerSignatureType
Signature []byte
Error error
Preimage ImageHashable
}

- // A Subdigest is a hash signed by a Sequence wallet's signers.
- // Used for type safety and preimage recovery.
- type Subdigest struct {
- common.Hash
-
- // Digest is the preimage of the subdigest, nil if unknown.
- Digest *Digest
-
- // Wallet is the target wallet of the subdigest, nil if unknown.
- Wallet *common.Address
-
- // ChainID is the target chain ID of the subdigest, nil if unknown.
- ChainID *big.Int
-
- // EthSignPreimage is the preimage of the eth_sign subdigest, nil if unknown.
- EthSignPreimage *Subdigest
- }

- type Digest struct {
- common.Hash
-
- // Preimage is the preimage of the digest, nil if unknown.
- Preimage []byte
- }
+type PayloadDigest struct {
+ common.Hash
+
+ Address_ common.Address
+ ChainID_ *big.Int
+
+ Payload Payload
+}

+type Payload interface {
+ Address() common.Address
+ ChainID() *big.Int
+
+ Digest() PayloadDigest
+}

-type SignerSignatures map[common.Address]map[common.Hash]SignerSignature
+type SignerSignatures map[common.Address]struct {
+ Signature *SignerSignature
+ SapientSignatures map[common.Hash]SignerSignature
+}
```

`core.Digest` & `core.Subdigest` were replaced by `core.DigestPayload`:

```diff
-subdigest := core.Subdigest{
- Hash: common.BytesToHash(msgDigest),
- Digest: nil,
- Wallet: nil,
- ChainID: nil,
-}
+subdigest := core.PayloadDigest{Hash: common.BytesToHash(msgDigest)}

-imageHash, weight, err := decoded.RecoverSubdigest(ctx, subdigest, nil)
+imageHash, weight, err := decoded.Recover(ctx, subdigest, nil)
```

```diff
-dig := core.Digest{
+dig := core.PayloadDigest{
Hash: digest,
}
-subdig := dig.Subdigest(s.Address, chainID)

```
Comment on lines +149 to +156
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-dig := core.Digest{
-	Hash: digest,
-}
-subdig := dig.Subdigest(s.Address, chainID)
+v2.Digest(digest, s.Address, chainID).Digest()


Loading