Skip to content

Commit

Permalink
Expose ExpectedValuesFor
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusx1211 authored and marino39 committed Oct 18, 2023
1 parent a9a8ed4 commit 937f887
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions intents/packets/send_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ func (p *SendTransactionsPacket) wallet() common.Address {
return common.HexToAddress(p.Wallet)
}

type expectedValuesForTransaction struct {
type ExpectedValuesForTransaction struct {
To *common.Address
Value *big.Int
Data []byte
}

func (p *SendTransactionsPacket) expectedValuesFor(subpacket *json.RawMessage) (*expectedValuesForTransaction, error) {
func (p *SendTransactionsPacket) ExpectedValuesFor(subpacket *json.RawMessage) (*ExpectedValuesForTransaction, error) {
// Get the subpacket type
var subpacketType struct {
Type string `json:"type"`
Expand Down Expand Up @@ -86,7 +86,7 @@ func (p *SendTransactionsPacket) expectedValuesFor(subpacket *json.RawMessage) (

data := common.FromHex(subpacketTransactionType.Data)

return &expectedValuesForTransaction{
return &ExpectedValuesForTransaction{
To: &to,
Value: value,
Data: data,
Expand Down Expand Up @@ -120,7 +120,7 @@ func (p *SendTransactionsPacket) expectedValuesFor(subpacket *json.RawMessage) (
return nil, err
}

return &expectedValuesForTransaction{
return &ExpectedValuesForTransaction{
To: &token,
Value: big.NewInt(0),
Data: data,
Expand Down Expand Up @@ -173,7 +173,7 @@ func (p *SendTransactionsPacket) expectedValuesFor(subpacket *json.RawMessage) (
}
}

return &expectedValuesForTransaction{
return &ExpectedValuesForTransaction{
To: &token,
Value: big.NewInt(0),
Data: encodedData,
Expand Down Expand Up @@ -229,7 +229,7 @@ func (p *SendTransactionsPacket) expectedValuesFor(subpacket *json.RawMessage) (
return nil, err
}

return &expectedValuesForTransaction{
return &ExpectedValuesForTransaction{
To: &token,
Value: big.NewInt(0),
Data: encodedData,
Expand Down Expand Up @@ -273,7 +273,7 @@ func (p *SendTransactionsPacket) IsValidInterpretation(subdigest common.Hash, tx
return false
}

expected, err := p.expectedValuesFor(&p.Transactions[i])
expected, err := p.ExpectedValuesFor(&p.Transactions[i])
if err != nil {
return false
}
Expand Down

0 comments on commit 937f887

Please sign in to comment.