Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
Add RD event type
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-es committed Jun 4, 2020
1 parent cb5bc96 commit c0c0f15
Show file tree
Hide file tree
Showing 20 changed files with 1,035 additions and 34 deletions.
4 changes: 2 additions & 2 deletions packages/actus-solidity/contracts/Core/ACTUSTypes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ contract ACTUSTypes {
bool isSet;
}

// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
enum EventType {NE, IED, FP, PR, PD, PRF, PY, PP, IP, IPCI, CE, RRF, RR, DV, PRD, MR, TD, SC, IPCB, MD, XD, STD, AD}
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
enum EventType {NE, IED, FP, PR, PD, PRF, PY, PP, IP, IPCI, CE, RRF, RR, DV, PRD, MR, TD, SC, IPCB, MD, RD, XD, STD, AD}
enum Calendar {NC, MF}
enum BusinessDayConvention {NOS, SCF, SCMF, CSF, CSMF, SCP, SCMP, CSP, CSMP}
enum ClearingHouse {Y, N}
Expand Down
2 changes: 1 addition & 1 deletion packages/actus-solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@nomiclabs/buidler": "^1.3.0",
"@nomiclabs/buidler-truffle5": "^1.3.0",
"@nomiclabs/buidler-web3": "^1.3.0",
"actus-dictionary": "https://github.com/actusfrf/actus-dictionary.git#dev",
"actus-dictionary": "https://github.com/atpar/actus-dictionary.git#feature_certf",
"bignumber.js": "^7.2.1",
"coveralls": "^3.0.9",
"csvtojson": "^2.0.8",
Expand Down
40 changes: 24 additions & 16 deletions packages/actus-solidity/test/helper/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@ const Web3Utils = require('web3-utils');


function getEpochOffsetForEventType (eventType) {
if (eventType === 1) { return 20; } // IED
if (eventType === 3) { return 25; } // PR
if (eventType === 8) { return 30; } // IP
if (eventType === 9) { return 40; } // IPCI
if (eventType === 2) { return 50; } // FP
if (eventType === 13) { return 60; } // DV
if (eventType === 15) { return 80; } // MR
if (eventType === 11) { return 90; } // RRF
if (eventType === 12) { return 100; } // RR
if (eventType === 17) { return 110; } // SC
if (eventType === 18) { return 120; } // IPCB
if (eventType === 14) { return 130; } // PRD
if (eventType === 16) { return 140; } // TD
if (eventType === 21) { return 150; } // STD
if (eventType === 19) { return 160; } // MD
if (eventType === 0) { return 950; } // AD
if (eventType === 0) { return 0; } // NE
if (eventType === 1) { return 1; } // IED
if (eventType === 2) { return 2; } // FP
if (eventType === 3) { return 3; } // PR
if (eventType === 4) { return 4; } // PR
if (eventType === 5) { return 5; } // PRF
if (eventType === 6) { return 6; } // PY
if (eventType === 7) { return 6; } // PP
if (eventType === 8) { return 8; } // IP
if (eventType === 9) { return 9; } // IPCI
if (eventType === 10) { return 10; } // CE
if (eventType === 11) { return 11; } // RRF
if (eventType === 12) { return 12; } // RR
if (eventType === 13) { return 13; } // DV
if (eventType === 14) { return 14; } // PRD
if (eventType === 15) { return 15; } // MR
if (eventType === 16) { return 16; } // TD
if (eventType === 17) { return 17; } // SC
if (eventType === 18) { return 18; } // IPCB
if (eventType === 19) { return 19; } // MD
if (eventType === 20) { return 20; } // RD
if (eventType === 21) { return 21; } // XD
if (eventType === 22) { return 22; } // STD
if (eventType === 23) { return 23; } // AD
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/actus-solidity/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ acorn@^6.0.7:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784"
integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==

"actus-dictionary@https://github.com/actusfrf/actus-dictionary.git#dev":
"actus-dictionary@https://github.com/atpar/actus-dictionary.git#feature_certf":
version "0.0.0"
resolved "https://github.com/actusfrf/actus-dictionary.git#608326b45701413e181693125e7e512134d03e63"
resolved "https://github.com/atpar/actus-dictionary.git#cdec7f3bea9d8b6d1f90be77e1b5baf08cf783e8"

address@^1.0.1:
version "1.1.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/ap-contracts/contracts/token/ICT/ICT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract ICT is IERC20, Ownable, DepositAllocater, Utils {
createDeposit(
_event,
scheduleTime,
false, // todo: add EventType for redemption
(eventType == EventType.RD),
terms.currency
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ contract('AssetActor', (accounts) => {
const xdEvent = await this.AssetRegistryInstance.getNextUnderlyingEvent(web3.utils.toHex(cecAssetId));
await mineBlock(Number(await getEventTime(xdEvent, lifecycleTermsCEC)));
await this.AssetActorInstance.progress(web3.utils.toHex(cecAssetId));
assert.equal(Number(decodeEvent(xdEvent).eventType), 20);
assert.equal(Number(decodeEvent(xdEvent).eventType), 21);

// progress collateral enhancement
const stdEvent = await this.AssetRegistryInstance.getNextUnderlyingEvent(web3.utils.toHex(cecAssetId));
await mineBlock(Number(await getEventTime(stdEvent, lifecycleTermsCEC)));
await this.AssetActorInstance.progress(web3.utils.toHex(cecAssetId));
assert.equal(Number(decodeEvent(stdEvent).eventType), 21);
assert.equal(Number(decodeEvent(stdEvent).eventType), 22);

// creator should have received seized collateral from custodian
assert.equal(
Expand Down
8 changes: 6 additions & 2 deletions packages/ap-contracts/ts-bindings/AccessControl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,17 @@ export class AccessControl extends Contract {
isEventSettled(
assetId: string | number[],
_event: string | number[]
): TransactionObject<boolean>;
): TransactionObject<{
0: boolean;
1: string;
}>;

isRegistered(assetId: string | number[]): TransactionObject<boolean>;

markEventAsSettled(
assetId: string | number[],
_event: string | number[]
_event: string | number[],
_payoff: number | string
): TransactionObject<void>;

popNextScheduledEvent(
Expand Down
8 changes: 6 additions & 2 deletions packages/ap-contracts/ts-bindings/AssetRegistry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,15 @@ export class AssetRegistry extends Contract {
isEventSettled(
assetId: string | number[],
_event: string | number[]
): TransactionObject<boolean>;
): TransactionObject<{
0: boolean;
1: string;
}>;

markEventAsSettled(
assetId: string | number[],
_event: string | number[]
_event: string | number[],
_payoff: number | string
): TransactionObject<void>;

popNextScheduledEvent(
Expand Down
31 changes: 31 additions & 0 deletions packages/ap-contracts/ts-bindings/Checkpoint.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Generated by ts-generator ver. 0.0.8 */
/* tslint:disable */

import BN from "bn.js";
import { Contract, ContractOptions } from "web3-eth-contract";
import { EventLog } from "web3-core";
import { EventEmitter } from "events";
import { ContractEvent, Callback, TransactionObject, BlockType } from "./types";

interface EventOptions {
filter?: object;
fromBlock?: BlockType;
topics?: string[];
}

export class Checkpoint extends Contract {
constructor(
jsonInterface: any[],
address?: string,
options?: ContractOptions
);
clone(): Checkpoint;
methods: {};
events: {
CheckpointCreated: ContractEvent<string>;
allEvents: (
options?: EventOptions,
cb?: Callback<EventLog>
) => EventEmitter;
};
}
98 changes: 98 additions & 0 deletions packages/ap-contracts/ts-bindings/CheckpointedToken.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/* Generated by ts-generator ver. 0.0.8 */
/* tslint:disable */

import BN from "bn.js";
import { Contract, ContractOptions } from "web3-eth-contract";
import { EventLog } from "web3-core";
import { EventEmitter } from "events";
import { ContractEvent, Callback, TransactionObject, BlockType } from "./types";

interface EventOptions {
filter?: object;
fromBlock?: BlockType;
topics?: string[];
}

export class CheckpointedToken extends Contract {
constructor(
jsonInterface: any[],
address?: string,
options?: ContractOptions
);
clone(): CheckpointedToken;
methods: {
allowance(owner: string, spender: string): TransactionObject<string>;

approve(
spender: string,
amount: number | string
): TransactionObject<boolean>;

balanceOf(account: string): TransactionObject<string>;

decreaseAllowance(
spender: string,
subtractedValue: number | string
): TransactionObject<boolean>;

holderCount(): TransactionObject<string>;

increaseAllowance(
spender: string,
addedValue: number | string
): TransactionObject<boolean>;

totalSupply(): TransactionObject<string>;

transfer(
recipient: string,
amount: number | string
): TransactionObject<boolean>;

transferFrom(
sender: string,
recipient: string,
amount: number | string
): TransactionObject<boolean>;

getHoldersAt(checkpointId: number | string): TransactionObject<string[]>;

getHolderSubsetAt(
checkpointId: number | string,
start: number | string,
end: number | string
): TransactionObject<string[]>;

getNumberOfHolders(): TransactionObject<string>;

balanceOfAt(
holder: string,
timestamp: number | string
): TransactionObject<string>;

totalSupplyAt(timestamp: number | string): TransactionObject<string>;
};
events: {
Approval: ContractEvent<{
owner: string;
spender: string;
value: string;
0: string;
1: string;
2: string;
}>;
CheckpointCreated: ContractEvent<string>;
Transfer: ContractEvent<{
from: string;
to: string;
value: string;
0: string;
1: string;
2: string;
}>;
allEvents: (
options?: EventOptions,
cb?: Callback<EventLog>
) => EventEmitter;
};
}
33 changes: 33 additions & 0 deletions packages/ap-contracts/ts-bindings/CheckpointedTokenStorage.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Generated by ts-generator ver. 0.0.8 */
/* tslint:disable */

import BN from "bn.js";
import { Contract, ContractOptions } from "web3-eth-contract";
import { EventLog } from "web3-core";
import { EventEmitter } from "events";
import { ContractEvent, Callback, TransactionObject, BlockType } from "./types";

interface EventOptions {
filter?: object;
fromBlock?: BlockType;
topics?: string[];
}

export class CheckpointedTokenStorage extends Contract {
constructor(
jsonInterface: any[],
address?: string,
options?: ContractOptions
);
clone(): CheckpointedTokenStorage;
methods: {
holderCount(): TransactionObject<string>;
};
events: {
CheckpointCreated: ContractEvent<string>;
allEvents: (
options?: EventOptions,
cb?: Callback<EventLog>
) => EventEmitter;
};
}
Loading

0 comments on commit c0c0f15

Please sign in to comment.