Skip to content

Commit

Permalink
added interface for new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sstanculeanu committed Oct 24, 2024
1 parent 7105ba3 commit 65c6724
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ type GuardedTransactionHandler interface {
GetDataForSigning(encoder Encoder, marshaller Marshaller, hasher Hasher) ([]byte, error)
}

// RelayedTransactionHandler defines functionality for the relayed transactions
type RelayedTransactionHandler interface {
GetRelayerAddr() []byte
GetRelayerSignature() []byte
}

// LogHandler defines the type for a log resulted from executing a transaction or smart contract call
type LogHandler interface {
// GetAddress returns the address of the sc that was originally called by the user
Expand Down
9 changes: 9 additions & 0 deletions data/transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ func (tx *Transaction) GetDataForSigning(encoder data.Encoder, marshaller data.M
ftx.GuardianAddr = guardianAddr
}

if len(tx.RelayerAddr) > 0 {
relayerAddr, errRelayer := encoder.Encode(tx.RelayerAddr)
if errRelayer != nil {
return nil, errRelayer
}

ftx.RelayerAddr = relayerAddr
}

ftxBytes, err := marshaller.Marshal(ftx)
if err != nil {
return nil, err
Expand Down

0 comments on commit 65c6724

Please sign in to comment.