graphql: add transaction signature values (#20623)
The feature update allows the GraphQL API endpoint to retrieve transaction signature R,S,V parameters. Co-authored-by: amitshah <amitshah0t7@gmail.com> Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
@ -314,6 +314,33 @@ func (t *Transaction) Logs(ctx context.Context) (*[]*Log, error) {
|
||||
return &ret, nil
|
||||
}
|
||||
|
||||
func (t *Transaction) R(ctx context.Context) (hexutil.Big, error) {
|
||||
tx, err := t.resolve(ctx)
|
||||
if err != nil || tx == nil {
|
||||
return hexutil.Big{}, err
|
||||
}
|
||||
_, r, _ := tx.RawSignatureValues()
|
||||
return hexutil.Big(*r), nil
|
||||
}
|
||||
|
||||
func (t *Transaction) S(ctx context.Context) (hexutil.Big, error) {
|
||||
tx, err := t.resolve(ctx)
|
||||
if err != nil || tx == nil {
|
||||
return hexutil.Big{}, err
|
||||
}
|
||||
_, _, s := tx.RawSignatureValues()
|
||||
return hexutil.Big(*s), nil
|
||||
}
|
||||
|
||||
func (t *Transaction) V(ctx context.Context) (hexutil.Big, error) {
|
||||
tx, err := t.resolve(ctx)
|
||||
if err != nil || tx == nil {
|
||||
return hexutil.Big{}, err
|
||||
}
|
||||
v, _, _ := tx.RawSignatureValues()
|
||||
return hexutil.Big(*v), nil
|
||||
}
|
||||
|
||||
type BlockType int
|
||||
|
||||
// Block represents an Ethereum block.
|
||||
|
Reference in New Issue
Block a user