Skip to content

Commit

Permalink
Adding the date field to the deployed SC (#209)
Browse files Browse the repository at this point in the history
* Adding SmartContract date deployed

* Using date Added on deployContract hook
  • Loading branch information
henrypalacios authored Oct 3, 2023
1 parent 3f2d328 commit 30ae44c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/domain/repositories/DeploymentRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface DeploymentItem {
network: ChainId
codeId: string
userAddress: string
date: string
}

export interface IDeploymentsRepository<A, B> {
Expand Down
7 changes: 5 additions & 2 deletions src/infrastructure/backendApi/ApiDeploymentRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface DeploymentRaw {
network: ChainId
code_id: string
user_address: string
date: string
}

export type IApiDeploymentRepository = IDeploymentsRepository<
Expand All @@ -26,7 +27,8 @@ function adaptDeployment(deploymentRaw: DeploymentRaw): DeploymentItem {
contractAddress: deploymentRaw.contract_address,
network: deploymentRaw.network,
codeId: deploymentRaw.code_id,
userAddress: deploymentRaw.user_address
userAddress: deploymentRaw.user_address,
date: deploymentRaw.date
}
}

Expand All @@ -43,7 +45,8 @@ export class ApiDeploymentRepository implements IApiDeploymentRepository {
contract_address: deployment.contractAddress,
network: deployment.network,
code_id: deployment.codeId,
user_address: deployment.userAddress
user_address: deployment.userAddress,
date: deployment.date
})
}
)
Expand Down
1 change: 0 additions & 1 deletion src/infrastructure/contractDryRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Abi } from '@polkadot/api-contract'
import { AbiParam, AbiMessage } from '@polkadot/api-contract/types'
import { ApiPromise } from '@polkadot/api'
import { ContractInstantiateResult } from '@polkadot/types/interfaces'
import { Registry } from '@polkadot/types-codec/types'

import { ContractConstructorDataForm } from '@/domain/wizard/step3DeployForm.types'
import { BIG_ZERO_BN } from '@/constants/numbers'
Expand Down
3 changes: 2 additions & 1 deletion src/view/wizardView/Step3Deploy/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ export default function Step3Deploy({
contractName: userContractsDetail.name as TokenType,
codeId: userContractsDetail.codeHash,
contractAddress: userContractsDetail.address,
network: userContractsDetail.blockchain as ChainId
network: userContractsDetail.blockchain as ChainId,
date: userContractsDetail.date
})
addUserContract(userContractsDetail)
}
Expand Down

0 comments on commit 30ae44c

Please sign in to comment.