You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now all transactions implement Signature() method, but we don't need it for L1Handler and Deploy transactions (right now they return empty slice).
We already faced some issues with it, here is an example:
switch transaction.(type) {
case *DeployTransaction, *L1HandlerTransaction:
digest.Update(&felt.Zero)
default:
digest.Update(transaction.Signature()...)
}
but code above may lead to more questions: why we're specifying exactly these transactions? is it specific to this function only or applicable to entire codebase?
It can be solved by introducing new interface type TransactionWithSignature (name only for example, I'm pretty sure there is a better naming):
type TransactionWithSignature interface {
Signature() []*felt.Felt
}
which can be used in example above as:
switch transaction.(type) {
case TransactionWithSignature:
digest.Update(transaction.Signature()...)
default:
digest.Update(&felt.Zero)
}
The text was updated successfully, but these errors were encountered:
Right now all transactions implement
Signature()
method, but we don't need it for L1Handler and Deploy transactions (right now they return empty slice).We already faced some issues with it, here is an example:
it was rewritten as:
but code above may lead to more questions: why we're specifying exactly these transactions? is it specific to this function only or applicable to entire codebase?
It can be solved by introducing new interface type
TransactionWithSignature
(name only for example, I'm pretty sure there is a better naming):which can be used in example above as:
The text was updated successfully, but these errors were encountered: