Skip to content

Commit

Permalink
feat: multi-chain payment abi (#896)
Browse files Browse the repository at this point in the history
* use payment abi from package
  • Loading branch information
volodymyr-basiuk authored Jan 17, 2025
1 parent 218a503 commit 249d5ae
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2,214 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/hashicorp/vault/api v1.14.0
github.com/hashicorp/vault/api/auth/userpass v0.7.0
github.com/iden3/contracts-abi/multi-chain-payment/go/abi v0.0.0-20250116162607-8fec43acf817
github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0
github.com/iden3/contracts-abi/state/go/abi v1.0.2-0.20230911112726-4533c5701af1
github.com/iden3/driver-did-iden3 v0.0.7
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/iden3/contracts-abi/multi-chain-payment/go/abi v0.0.0-20250116162607-8fec43acf817 h1:xuYOzprI4R11ty8CpFAO8cmsDpLpMBkTaAo4Jb640Po=
github.com/iden3/contracts-abi/multi-chain-payment/go/abi v0.0.0-20250116162607-8fec43acf817/go.mod h1:T3jzISOZAzewRmzTxzGzj91V8MP+usTdPYbRE68hLyA=
github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0 h1:Fu1/tAINi9FzZ0nKoEVOGXWzL1l15tR1loJx5sQEQ8k=
github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0/go.mod h1:8fkd2xyUG/V7ovpvZRyD2LyK2zZ4ALbgf5vJGyhzKdg=
github.com/iden3/contracts-abi/rhs-storage/go/abi v0.0.0-20231006141557-7d13ef7e3c48 h1:/g4rru+OM5WAhVNXEpowKH+vWZLGjgpk5+O8Stu4QBo=
Expand Down
5 changes: 3 additions & 2 deletions internal/core/services/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/signer/core/apitypes"
"github.com/google/uuid"
abi "github.com/iden3/contracts-abi/multi-chain-payment/go/abi"
core "github.com/iden3/go-iden3-core/v2"
"github.com/iden3/go-iden3-core/v2/w3c"
comm "github.com/iden3/iden3comm/v2"
Expand Down Expand Up @@ -256,7 +257,7 @@ func (p *payment) VerifyPayment(ctx context.Context, issuerDID w3c.DID, nonce *b
return ports.BlockchainPaymentStatusPending, fmt.Errorf("failed to get ethereum client from resolvers settings for key <%s>", paymentReqItem.SigningKeyID)
}

instance, err := eth.NewPaymentContract(setting.PaymentRails, client.GetEthereumClient())
instance, err := abi.NewMCPayment(setting.PaymentRails, client.GetEthereumClient())
if err != nil {
return ports.BlockchainPaymentStatusPending, err
}
Expand All @@ -277,7 +278,7 @@ func (p *payment) VerifyPayment(ctx context.Context, issuerDID w3c.DID, nonce *b
func (p *payment) verifyPaymentOnBlockchain(
ctx context.Context,
client *eth.Client,
contract *eth.PaymentContract,
contract *abi.MCPayment,
signerAddress common.Address,
nonce *big.Int,
txID *string,
Expand Down
Loading

0 comments on commit 249d5ae

Please sign in to comment.