Skip to content

Commit

Permalink
Merge pull request #167 from walt-id/providers_update
Browse files Browse the repository at this point in the history
chore : updated provider keys
  • Loading branch information
SuperBatata authored Apr 15, 2024
2 parents e475dd8 + 3efd9bf commit 9a1f788
Show file tree
Hide file tree
Showing 19 changed files with 90 additions and 89 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ tasks.withType<Test> {
// > gradle build -PrunIntegrationTests
if (!project.hasProperty("runIntegrationTests")) {
exclude("id/walt/nftkit/blockchainTransactionsCalls/**")
exclude("id/walt/nftkit/blockchainReadingOperations/**")
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/id/walt/nftkit/Values.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ object Values {
const val ETHEREUM_TESTNET_GOERLI_CHAIN_ID: Long = 5
const val ETHEREUM_TESTNET_SEPOLIA_CHAIN_ID: Long = 11155111
const val POLYGON_MAINNET_CHAIN_ID: Long = 137
const val POLYGON_TESTNET_MUMBAI_CHAIN_ID: Long = 80001
const val POLYGON_TESTNET_AMOY_CHAIN_ID: Long = 80002
const val MOONBEAM_MAINNET_CHAIN_ID: Long = 1284
const val ASTAR_MAINNET_CHAIN_ID: Long = 592
const val SHIMMEREVM_TESTNET_CHAIN_ID: Long = 1073
Expand All @@ -18,21 +18,21 @@ object Values {
const val ETHEREUM_TESTNET_GOERLI_SCAN_API_URL = "api-goerli.etherscan.io"
const val ETHEREUM_TESTNET_SEPOLIA_SCAN_API_URL = "api-sepolia.etherscan.io"
const val POLYGON_MAINNET_SCAN_API_URL = "api.polygonscan.com"
const val POLYGON_TESTNET_MUMBAI_SCAN_API_URL = "api-testnet.polygonscan.com"
const val POLYGON_TESTNET_AMOY_SCAN_API_URL = "api-testnet.polygonscan.com"
const val SHIMMEREVM_APPCHAIN_BLOCK_EXPLORER_URL = ""

const val ETHEREUM_MAINNET_BLOCK_EXPLORER_URL = "https://etherscan.io"
const val ETHEREUM_TESTNET_GOERLI_BLOCK_EXPLORER_URL = "https://goerli.etherscan.io/"
const val ETHEREUM_TESTNET_SEPOLIA_BLOCK_EXPLORER_URL = "https://sepolia.etherscan.io/"
const val POLYGON_MAINNET_BLOCK_EXPLORER_URL = "https://polygonscan.com"
const val POLYGON_TESTNET_MUMBAI_BLOCK_EXPLORER_URL = "https://mumbai.polygonscan.com"
const val SHIMMEREVM_TESTNET_BLOCK_EXPLORER_URL = "explorer.evm.testnet.shimmer.network"
const val POLYGON_TESTNET_AMOY_BLOCK_EXPLORER_URL = "https://www.oklink.com/amoy"
const val SHIMMEREVM_TESTNET_BLOCK_EXPLORER_URL = "https://explorer.evm.testnet.shimmer.network/"

const val ETHEREUM_MAINNET_ALCHEMY_URL = "https://eth-mainnet.alchemyapi.io/v2/"
const val ETHEREUM_TESTNET_GOERLI_ALCHEMY_URL = "https://eth-goerli.g.alchemy.com/v2/"
const val ETHEREUM_TESTNET_SEPOLIA_ALCHEMY_URL = "https://eth-sepolia.g.alchemy.com/v2/"
const val POLYGON_MAINNET_ALCHEMY_URL = "https://polygon-mainnet.g.alchemy.com/v2/"
const val POLYGON_TESTNET_MUMBAI_ALCHEMY_URL = "https://polygon-mumbai.g.alchemy.com/v2/"
const val POLYGON_TESTNET_AMOY_ALCHEMY_URL = "https://polygon-amoy.g.alchemy.com/v2/"

const val TEZOS_MAINNET_BETTER_CALL_DEV = "https://better-call.dev/mainnet"
const val TEZOS_GHOSTNET_BETTER_CALL_DEV = "https://better-call.dev/ghostnet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ object Erc721TokenStandard : IErc721TokenStandard {
val credentials: Credentials = Credentials.create(WaltIdServices.loadChainConfig().privateKey)
val gasProvider: ContractGasProvider = WaltIdGasProvider
val remotCall : RemoteCall<ERC721URIStorage>
if(chain == Chain.POLYGON || chain == Chain.MUMBAI){
if(chain == Chain.POLYGON || chain == Chain.AMOY){
val chainId : Long
if(chain == Chain.POLYGON){
chainId = Values.POLYGON_MAINNET_CHAIN_ID
}else{
chainId = Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
chainId = Values.POLYGON_TESTNET_AMOY_CHAIN_ID
}
val transactionManager: TransactionManager = RawTransactionManager(
web3j, credentials, chainId
Expand Down Expand Up @@ -182,12 +182,12 @@ object Erc721TokenStandard : IErc721TokenStandard {
val credentials: Credentials = Credentials.create(WaltIdServices.loadChainConfig().privateKey)
val gasProvider: ContractGasProvider = WaltIdGasProvider
val remotCall: RemoteCall<CustomOwnableERC721>
if (chain == EVMChain.POLYGON || chain == EVMChain.MUMBAI) {
if (chain == EVMChain.POLYGON || chain == EVMChain.AMOY) {
val chainId: Long
if (chain == EVMChain.POLYGON) {
chainId = Values.POLYGON_MAINNET_CHAIN_ID
} else {
chainId = Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
chainId = Values.POLYGON_TESTNET_AMOY_CHAIN_ID
}
val transactionManager: TransactionManager = RawTransactionManager(
web3j, credentials, chainId
Expand Down Expand Up @@ -228,12 +228,12 @@ object Erc721TokenStandard : IErc721TokenStandard {
val credentials: Credentials = Credentials.create(WaltIdServices.loadChainConfig().privateKey)
val gasProvider: ContractGasProvider = WaltIdGasProvider
val remotCall: RemoteCall<CustomAccessControlERC721>
if (chain == EVMChain.POLYGON || chain == EVMChain.MUMBAI) {
if (chain == EVMChain.POLYGON || chain == EVMChain.AMOY) {
val chainId: Long
if (chain == EVMChain.POLYGON) {
chainId = Values.POLYGON_MAINNET_CHAIN_ID
} else {
chainId = Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
chainId = Values.POLYGON_TESTNET_AMOY_CHAIN_ID
}
val transactionManager: TransactionManager = RawTransactionManager(
web3j, credentials, chainId
Expand Down Expand Up @@ -290,7 +290,7 @@ object Erc721TokenStandard : IErc721TokenStandard {
EVMChain.GOERLI -> Values.ETHEREUM_TESTNET_GOERLI_CHAIN_ID
EVMChain.SEPOLIA -> Values.ETHEREUM_TESTNET_SEPOLIA_CHAIN_ID
EVMChain.POLYGON -> Values.POLYGON_MAINNET_CHAIN_ID
EVMChain.MUMBAI -> Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
EVMChain.AMOY -> Values.POLYGON_TESTNET_AMOY_CHAIN_ID
EVMChain.ASTAR -> Values.ASTAR_MAINNET_CHAIN_ID
EVMChain.MOONBEAM -> Values.MOONBEAM_MAINNET_CHAIN_ID
EVMChain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_CHAIN_ID
Expand All @@ -300,12 +300,12 @@ object Erc721TokenStandard : IErc721TokenStandard {
web3j, credentials, chainId
)
return CustomOwnableERC721.load(address, web3j,transactionManager,gasProvider)
/*if (chain == EVMChain.POLYGON || chain == EVMChain.MUMBAI) {
/*if (chain == EVMChain.POLYGON || chain == EVMChain.AMOY) {
val chainId: Long
if (chain == EVMChain.POLYGON) {
chainId = Values.POLYGON_MAINNET_CHAIN_ID
} else {
chainId = Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
chainId = Values.POLYGON_TESTNET_AMOY_CHAIN_ID
}
val transactionManager: TransactionManager = RawTransactionManager(
web3j, credentials, chainId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object SoulBoundTokenStandard : ISoulBoundTokenStandard {
EVMChain.GOERLI -> Values.ETHEREUM_TESTNET_GOERLI_CHAIN_ID
EVMChain.SEPOLIA -> Values.ETHEREUM_TESTNET_SEPOLIA_CHAIN_ID
EVMChain.POLYGON -> Values.POLYGON_MAINNET_CHAIN_ID
EVMChain.MUMBAI -> Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
EVMChain.AMOY -> Values.POLYGON_TESTNET_AMOY_CHAIN_ID
EVMChain.ASTAR -> Values.ASTAR_MAINNET_CHAIN_ID
EVMChain.MOONBEAM -> Values.MOONBEAM_MAINNET_CHAIN_ID
EVMChain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_CHAIN_ID
Expand Down Expand Up @@ -102,7 +102,7 @@ object SoulBoundTokenStandard : ISoulBoundTokenStandard {
EVMChain.GOERLI -> Values.ETHEREUM_TESTNET_GOERLI_CHAIN_ID
EVMChain.SEPOLIA -> Values.ETHEREUM_TESTNET_SEPOLIA_CHAIN_ID
EVMChain.POLYGON -> Values.POLYGON_MAINNET_CHAIN_ID
EVMChain.MUMBAI -> Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
EVMChain.AMOY -> Values.POLYGON_TESTNET_AMOY_CHAIN_ID
EVMChain.ASTAR -> Values.ASTAR_MAINNET_CHAIN_ID
EVMChain.MOONBEAM -> Values.MOONBEAM_MAINNET_CHAIN_ID
EVMChain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_CHAIN_ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ object AccessControlService {

val gasProvider: ContractGasProvider = WaltIdGasProvider

if (chain == EVMChain.POLYGON || chain == EVMChain.MUMBAI) {
if (chain == EVMChain.POLYGON || chain == EVMChain.AMOY) {
val chainId: Long
if (chain == EVMChain.POLYGON) {
chainId = Values.POLYGON_MAINNET_CHAIN_ID
} else {
chainId = Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
chainId = Values.POLYGON_TESTNET_AMOY_CHAIN_ID
}
val transactionManager: TransactionManager = RawTransactionManager(
web3j, credentials, chainId
Expand All @@ -111,12 +111,12 @@ object AccessControlService {

val gasProvider: ContractGasProvider = WaltIdGasProvider

if (chain == EVMChain.POLYGON || chain == EVMChain.MUMBAI) {
if (chain == EVMChain.POLYGON || chain == EVMChain.AMOY) {
val chainId: Long
if (chain == EVMChain.POLYGON) {
chainId = Values.POLYGON_MAINNET_CHAIN_ID
} else {
chainId = Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
chainId = Values.POLYGON_TESTNET_AMOY_CHAIN_ID
}
val transactionManager: TransactionManager = RawTransactionManager(
web3j, credentials, chainId
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/id/walt/nftkit/services/ExtensionsService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ object ExtensionsService {

val gasProvider: ContractGasProvider = WaltIdGasProvider

if (chain == EVMChain.POLYGON || chain == EVMChain.MUMBAI) {
if (chain == EVMChain.POLYGON || chain == EVMChain.AMOY) {
val chainId: Long
if (chain == EVMChain.POLYGON) {
chainId = Values.POLYGON_MAINNET_CHAIN_ID
} else {
chainId = Values.POLYGON_TESTNET_MUMBAI_CHAIN_ID
chainId = Values.POLYGON_TESTNET_AMOY_CHAIN_ID
}
val transactionManager: TransactionManager = RawTransactionManager(
web3j, credentials, chainId
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/id/walt/nftkit/services/NftService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ enum class Chain {
POLYGON,
GOERLI,
SEPOLIA,
MUMBAI,
AMOY,
TEZOS,
GHOSTNET,
MAINNET,
Expand All @@ -103,7 +103,7 @@ enum class EVMChain {
POLYGON,
GOERLI,
SEPOLIA,
MUMBAI,
AMOY,
ASTAR,
MOONBEAM,
SHIMMEREVM,
Expand Down Expand Up @@ -538,7 +538,7 @@ object NftService {
Chain.GOERLI -> Values.ETHEREUM_TESTNET_GOERLI_ALCHEMY_URL
Chain.SEPOLIA -> Values.ETHEREUM_TESTNET_SEPOLIA_ALCHEMY_URL
Chain.POLYGON -> Values.POLYGON_MAINNET_ALCHEMY_URL
Chain.MUMBAI -> Values.POLYGON_TESTNET_MUMBAI_ALCHEMY_URL
Chain.AMOY -> Values.POLYGON_TESTNET_AMOY_ALCHEMY_URL
Chain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_BLOCK_EXPLORER_URL
Chain.TEZOS -> throw Exception("Tezos is not supported")
Chain.GHOSTNET -> throw Exception("Ghostnet is not supported")
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/id/walt/nftkit/services/WaltIdServices.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class Providers(
val goerli: String,
val sepolia: String,
val polygon: String,
val mumbai: String,
val amoy: String,
val astar: String,
val moonbeam: String,
val opal: String,
Expand Down Expand Up @@ -145,7 +145,7 @@ object WaltIdServices {
EVMChain.GOERLI -> Values.ETHEREUM_TESTNET_GOERLI_BLOCK_EXPLORER_URL
EVMChain.SEPOLIA -> Values.ETHEREUM_TESTNET_SEPOLIA_BLOCK_EXPLORER_URL
EVMChain.POLYGON -> Values.POLYGON_MAINNET_BLOCK_EXPLORER_URL
EVMChain.MUMBAI -> Values.POLYGON_TESTNET_MUMBAI_BLOCK_EXPLORER_URL
EVMChain.AMOY -> Values.POLYGON_TESTNET_AMOY_BLOCK_EXPLORER_URL
EVMChain.SHIMMEREVM -> Values.SHIMMEREVM_TESTNET_BLOCK_EXPLORER_URL
EVMChain.SHIMMEREVM_APPCHAIN -> Values.SHIMMEREVM_APPCHAIN_BLOCK_EXPLORER_URL
else -> {
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/id/walt/nftkit/utilis/Common.kt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ object Common {
EVMChain.GOERLI -> Values.ETHEREUM_TESTNET_GOERLI_SCAN_API_URL
EVMChain.SEPOLIA -> Values.ETHEREUM_TESTNET_SEPOLIA_SCAN_API_URL
EVMChain.POLYGON -> Values.POLYGON_MAINNET_SCAN_API_URL
EVMChain.MUMBAI -> Values.POLYGON_TESTNET_MUMBAI_SCAN_API_URL
EVMChain.AMOY -> Values.POLYGON_TESTNET_AMOY_SCAN_API_URL
else -> {throw Exception("$chain is not supported")}
}
}
Expand All @@ -107,14 +107,14 @@ object Common {
EVMChain.GOERLI -> WaltIdServices.loadApiKeys().apiKeys.ethereumBlockExplorer
EVMChain.SEPOLIA -> WaltIdServices.loadApiKeys().apiKeys.ethereumBlockExplorer
EVMChain.POLYGON -> WaltIdServices.loadApiKeys().apiKeys.polygonBlockExplorer
EVMChain.MUMBAI -> WaltIdServices.loadApiKeys().apiKeys.polygonBlockExplorer
EVMChain.AMOY -> WaltIdServices.loadApiKeys().apiKeys.polygonBlockExplorer
EVMChain.SHIMMEREVM -> WaltIdServices.loadApiKeys().apiKeys.shimmerBlockExplorer
else -> {throw Exception("$chain is not supported")}
}
}

fun isEVMChain(chain: Chain): Boolean{
val EVMChains= listOf(Chain.ETHEREUM, Chain.POLYGON, Chain.GOERLI, Chain.SEPOLIA, Chain.MUMBAI, Chain.SHIMMEREVM , Chain.SHIMMEREVM_APPCHAIN)
val EVMChains= listOf(Chain.ETHEREUM, Chain.POLYGON, Chain.GOERLI, Chain.SEPOLIA, Chain.AMOY, Chain.SHIMMEREVM , Chain.SHIMMEREVM_APPCHAIN)
return chain in EVMChains
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import id.walt.nftkit.services.WaltIdServices
import org.web3j.protocol.Web3j
import org.web3j.protocol.http.HttpService

class MumbaiWeb3 : Web3jInstance {
class AmoyWeb3 : Web3jInstance {
override fun getWeb3j(): Web3j {
return Web3j.build(HttpService(WaltIdServices.loadChainConfig().providers.mumbai))
return Web3j.build(HttpService(WaltIdServices.loadChainConfig().providers.amoy))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object ProviderFactory {
EVMChain.GOERLI -> GoerliWeb3()
EVMChain.SEPOLIA -> SepoliaWeb3()
EVMChain.POLYGON -> PolygonWeb3()
EVMChain.MUMBAI -> MumbaiWeb3()
EVMChain.AMOY -> AmoyWeb3()
EVMChain.ASTAR -> AstarWeb3()
EVMChain.MOONBEAM -> MoonbeamWeb3()
EVMChain.SHIMMEREVM -> IotaWeb3()
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/walt-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ azureKeyVaultConfig:

providers:
ethereum: "ethereum"
goerli: "https://eth-goerli.g.alchemy.com/v2/nC_mn2_pURV1zQvQAM5xFFMKVxLbvHbk"
sepolia: "https://eth-sepolia.g.alchemy.com/v2/LSlLS4At2l4RfC9x_Z_913wtdlZ2wEJK"
polygon: "https://polygon-mainnet.g.alchemy.com/v2/J-GrcOix50BCbOVuVybCFEmKAeKQNBtr"
mumbai: "https://polygon-mumbai.g.alchemy.com/v2/zyd0WGIMKdIdBGhDYX9bGwD7iVshxdCi"
goerli: "https://eth-goerli.g.alchemy.com/v2/x4Ovq8l3SL30X4B3Uz7Q9aYhxVfxhIFg"
sepolia: "https://eth-sepolia.g.alchemy.com/v2/FFX-XLBauFYuxdKDF5QUHCt7AlSGAs5q"
polygon: "https://polygon-mainnet.g.alchemy.com/v2/SUV8QnbFOKnb5eMk5amGinUMCamjLT4l"
amoy: "https://polygon-amoy.g.alchemy.com/v2/JzLeph1oVQq2hQByKZYMyVLCjMaZ2J-K"
astar: "https://evm.astar.network"
moonbeam: "https://rpc.api.moonbeam.network"
unique: "https://rpc.unique.network"
Expand Down Expand Up @@ -59,8 +59,8 @@ polkadotAccounts:
apiKeys:
ethereumBlockExplorer: "xEakmyYnTV2XB7xluT3Ot6PYhf4M3OuE"
polygonBlockExplorer: "C0cILVib97lQAQ_y32UsM-0Rb3n8Tozj"
alchemy: "zyd0WGIMKdIdBGhDYX9bGwD7iVshxdCi"
nftstorage: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweEIwNGU5YzMyNzczNjI1MEQ0QTkzQjZmYThjODUwNzQwQkI0N0YyMmYiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTcwNDgzMTk2NjUxNiwibmFtZSI6IndhbHRfaWRfbmV3In0.US2XREzruFyovZKHTzRn_TXOJg9mxo1YVUL5JvdHuZ4"
alchemy: "JzLeph1oVQq2hQByKZYMyVLCjMaZ2J-K"
nftstorage: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweEIwNGU5YzMyNzczNjI1MEQ0QTkzQjZmYThjODUwNzQwQkI0N0YyMmYiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTcxMzE4Nzg3MjQ3NywibmFtZSI6Im5ldyJ9.erLykT5fM3nFG1TkxYB9I2783wq9W6Iurn1FJch4OvI"
subscan: ""
shimmerBlockExplorer: "52bb3024-d769-44e7-afa8-8845ee4a4419"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,43 @@ class Erc721Standard : StringSpec({

"Verifying nft metadata".config(){
val tokenid = BigInteger.valueOf(3)
val result = NftService.getNftMetadata(EVMChain.MUMBAI, "0xf277BE034881eE38A9b270E5b6C5c6f333Af2517", tokenid )
val result = NftService.getNftMetadata(EVMChain.AMOY, "0xf277BE034881eE38A9b270E5b6C5c6f333Af2517", tokenid )
result.name shouldBe "Ticket #1"
result.description shouldBe "Ticket #1 Description"

}

"Verifying Metadata URI".config(){
val tokenid = BigInteger.valueOf(10)
val result = NftService.getNftMetadataUri(EVMChain.MUMBAI,"0xf277BE034881eE38A9b270E5b6C5c6f333Af2517", tokenid )
val result = NftService.getNftMetadataUri(EVMChain.AMOY,"0xf277BE034881eE38A9b270E5b6C5c6f333Af2517", tokenid )
result shouldBe "ipfs://bafyreiebsxbmwmgrzlrhlpwj2mmz5j64vsfojfy7lviu22unkkmjdhfqt4/metadata.json"
}

"Verifying balance of address".config(){
val result = NftService.balanceOf(EVMChain.MUMBAI,
val result = NftService.balanceOf(EVMChain.AMOY,
"0xf277BE034881eE38A9b270E5b6C5c6f333Af2517",
"0xe895D59e84d0E77a8DaEaA55547528406C5a1314")
result shouldBe BigInteger.valueOf(2)
}

"Verifying owner of a token".config(){
val tokenid = BigInteger.valueOf(35)
val result = NftService.ownerOf(EVMChain.MUMBAI,
val result = NftService.ownerOf(EVMChain.AMOY,
"0xf277BE034881eE38A9b270E5b6C5c6f333Af2517",
tokenid)
result shouldBe "0xe895d59e84d0e77a8daeaa55547528406c5a1314"
}

"Verifying token collection info".config(){
val result = NftService.getTokenCollectionInfo(EVMChain.MUMBAI,
val result = NftService.getTokenCollectionInfo(EVMChain.AMOY,
"0xf277BE034881eE38A9b270E5b6C5c6f333Af2517" )
result.name shouldBe "Ticket"
result.symbol shouldBe "TK"
}

//TODO: Fix https://docs.alchemy.com/reference/getnfts
// "Verifying account NFTs by Alchmy".config(){
// val result = NftService.getAccountNFTsByAlchemy(Chain.MUMBAI,
// val result = NftService.getAccountNFTsByAlchemy(Chain.AMOY,
// "0xe895D59e84d0E77a8DaEaA55547528406C5a1314" )
// result[0].id.tokenId shouldBe "35"
// result[1].id.tokenId shouldBe "36"
Expand All @@ -60,7 +60,7 @@ class Erc721Standard : StringSpec({

"Verifying IPFS metadata using NFTs storage".config(){
val tokenid = BigInteger.valueOf(3)
var uri = NftService.getNftMetadataUri(EVMChain.MUMBAI,"0x7Bf34C715e9A7ADEc6c4fa1CFEE4120E2808fD8c" ,tokenid)
var uri = NftService.getNftMetadataUri(EVMChain.AMOY,"0x7Bf34C715e9A7ADEc6c4fa1CFEE4120E2808fD8c" ,tokenid)
val result = NftService.getIPFSMetadataUsingNFTStorage(uri)
result.description shouldBe "Walt Membership"
result.name shouldBe "Walt Membership"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import io.kotest.matchers.shouldNotBe
class EvmBasedAccessControl : StringSpec({

"Verify smart contract ownership".config() {
val result= AccessControlService.owner(EVMChain.MUMBAI, "0xf277BE034881eE38A9b270E5b6C5c6f333Af2517")
val result= AccessControlService.owner(EVMChain.AMOY, "0xf277BE034881eE38A9b270E5b6C5c6f333Af2517")
result shouldBe "0xaf87c5ce7a1fb6bd5aadb6dd9c0b8ef51ef1bc31"
}

"Testing the role".config() {
val result = AccessControlService.hasRole(EVMChain.MUMBAI,"0xa5a0914988bAB4e773109969A9176855eA77FcfB", "MINTER_ROLE", "0xaf87c5ce7a1fb6bd5aadb6dd9c0b8ef51ef1bc31")
val result = AccessControlService.hasRole(EVMChain.AMOY,"0xa5a0914988bAB4e773109969A9176855eA77FcfB", "MINTER_ROLE", "0xaf87c5ce7a1fb6bd5aadb6dd9c0b8ef51ef1bc31")
result shouldBe true
}

"Get admin of an account".config(){
val result = AccessControlService.getRoleAdmin(EVMChain.MUMBAI, "0xa5a0914988bAB4e773109969A9176855eA77FcfB","MINTER_ROLE")
val result = AccessControlService.getRoleAdmin(EVMChain.AMOY, "0xa5a0914988bAB4e773109969A9176855eA77FcfB","MINTER_ROLE")
result shouldBe "00000000000000000000000000000000"
}

Expand Down
Loading

0 comments on commit 9a1f788

Please sign in to comment.