Skip to content

Commit

Permalink
Remove "data" parameter for token pools
Browse files Browse the repository at this point in the history
With the introduction of a separate trackingId field, there's no longer any
useful data to be passed here.

Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
  • Loading branch information
awrichar committed Nov 4, 2021
1 parent 74cd053 commit fe49c0a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
7 changes: 0 additions & 7 deletions src/tokens/tokens.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ export class TokenPool {
@ApiProperty({ description: poolConfigDescription })
@IsOptional()
config?: any;

@ApiProperty()
@IsOptional()
data?: string; // TODO: remove
}

export class TokenBalanceQuery {
Expand Down Expand Up @@ -191,9 +187,6 @@ class tokenEventBase {
export class TokenPoolEvent extends tokenEventBase {
@ApiProperty()
standard: string;

@ApiProperty()
data?: string; // TODO: remove
}

export class TokenTransferEvent extends tokenEventBase {
Expand Down
2 changes: 0 additions & 2 deletions src/tokens/tokens.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export class TokensService {
async createPool(dto: TokenPool): Promise<AsyncResponse> {
const dataToPack: PackedTokenData = {
trackingId: dto.trackingId,
data: dto.data, // TODO: remove
};
const response = await lastValueFrom(
this.http.post<EthConnectAsyncResponse>(
Expand Down Expand Up @@ -243,7 +242,6 @@ class TokenListener implements EventListener {
type: unpackedId.isFungible ? TokenType.FUNGIBLE : TokenType.NONFUNGIBLE,
operator: data.operator,
trackingId: unpackedData.trackingId,
data: unpackedData.data, // TODO: remove
transaction: {
blockNumber: event.blockNumber,
transactionIndex: event.transactionIndex,
Expand Down
7 changes: 2 additions & 5 deletions test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ describe('AppController (e2e)', () => {
type: TokenType.FUNGIBLE,
requestId: 'op1',
trackingId: 'tx1',
data: 'test',
operator: IDENTITY,
};
const response: EthConnectAsyncResponse = {
Expand All @@ -156,7 +155,7 @@ describe('AppController (e2e)', () => {
expect(http.post).toHaveBeenCalledWith(
`${INSTANCE_URL}/create`,
{
data: '0x7b22747261636b696e674964223a22747831222c2264617461223a2274657374227d',
data: '0x7b22747261636b696e674964223a22747831227d',
is_fungible: true,
},
{
Expand All @@ -172,7 +171,6 @@ describe('AppController (e2e)', () => {
it('Create non-fungible pool', async () => {
const request: TokenPool = {
type: TokenType.NONFUNGIBLE,
data: 'test',
operator: '0xabc',
};
const response: EthConnectAsyncResponse = {
Expand All @@ -188,7 +186,7 @@ describe('AppController (e2e)', () => {
expect(http.post).toHaveBeenCalledWith(
`${INSTANCE_URL}/create`,
{
data: '0x7b2264617461223a2274657374227d',
data: '0x7b7d',
is_fungible: false,
},
{
Expand Down Expand Up @@ -377,7 +375,6 @@ describe('AppController (e2e)', () => {
expect(message).toEqual(<WebSocketMessage>{
event: 'token-pool',
data: <TokenPoolEvent>{
data: 'test',
trackingId: 'tx1',
standard: 'ERC1155',
poolId: 'F1',
Expand Down

0 comments on commit fe49c0a

Please sign in to comment.