Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

156 created to createdat2 #168

Merged
merged 4 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chain-api/src/types/TokenBalance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function createHold(instance: BigNumber, expires: number, quantity?: BigNumber,
createdBy: "user1",
instanceId: instance,
quantity: quantity ?? new BigNumber(1),
created: 1,
createdAt: 1,
expires: expires,
name: name
});
Expand Down
14 changes: 7 additions & 7 deletions chain-api/src/types/TokenBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ export class TokenBalance extends ChainObject {

public ensureCanLockQuantity(hold: TokenHold): { lock(): void } {
this.ensureTokenQuantityHoldIsFungible(hold);
this.ensureQuantityIsSpendable(hold.quantity, hold.created);
this.ensureQuantityIsSpendable(hold.quantity, hold.createdAt);

const lock = () => {
this.lockedHolds = [...this.getUnexpiredLockedHolds(hold.created), hold];
this.lockedHolds = [...this.getUnexpiredLockedHolds(hold.createdAt), hold];
};

return { lock };
Expand Down Expand Up @@ -503,7 +503,7 @@ export class TokenBalance extends ChainObject {

const partialQuantityHold = new TokenHold({
createdBy: hold.createdBy,
created: hold.created,
createdAt: hold.createdAt,
instanceId: hold.instanceId,
expires: hold.expires,
name: hold.name,
Expand Down Expand Up @@ -570,7 +570,7 @@ export class TokenHold {

@IsPositive()
@IsInt()
public readonly created: number;
public readonly createdAt: number;

@Min(0)
@IsInt()
Expand All @@ -594,7 +594,7 @@ export class TokenHold {
createdBy: string;
instanceId: BigNumber;
quantity: BigNumber;
created: number;
createdAt: number;
expires?: number;
name?: string;
lockAuthority?: string;
Expand All @@ -603,7 +603,7 @@ export class TokenHold {
this.createdBy = params.createdBy;
this.instanceId = params.instanceId;
this.quantity = params.quantity;
this.created = params.created;
this.createdAt = params.createdAt;
this.expires = params.expires ?? TokenHold.DEFAULT_EXPIRES;
if (params.name) {
this.name = params.name;
Expand All @@ -618,7 +618,7 @@ export class TokenHold {
createdBy: string;
instanceId: BigNumber;
quantity: BigNumber;
created: number;
createdAt: number;
expires: number | undefined;
name: string | undefined;
lockAuthority: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion chain-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @gala-chain/cli
$ galachain COMMAND
running command...
$ galachain (--version)
@gala-chain/cli/1.1.10 darwin-arm64 node-v16.20.2
@gala-chain/cli/1.1.10 linux-x64 node-v18.17.0
$ galachain --help [COMMAND]
USAGE
$ galachain COMMAND
Expand Down
64 changes: 32 additions & 32 deletions chain-cli/chaincode-template/e2e/__snapshots__/api.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"inUseHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -1574,7 +1574,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand All @@ -1585,7 +1585,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"lockedHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -1619,7 +1619,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand Down Expand Up @@ -3834,7 +3834,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"inUseHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -3868,7 +3868,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand All @@ -3879,7 +3879,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"lockedHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -3913,7 +3913,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand Down Expand Up @@ -4114,7 +4114,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"inUseHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -4148,7 +4148,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand All @@ -4159,7 +4159,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"lockedHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -4193,7 +4193,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand Down Expand Up @@ -4891,7 +4891,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"inUseHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -4925,7 +4925,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand All @@ -4936,7 +4936,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"lockedHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -4970,7 +4970,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand Down Expand Up @@ -5354,7 +5354,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"inUseHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -5388,7 +5388,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand All @@ -5399,7 +5399,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"lockedHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -5433,7 +5433,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand Down Expand Up @@ -5594,7 +5594,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"inUseHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -5628,7 +5628,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand All @@ -5639,7 +5639,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"lockedHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -5673,7 +5673,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand Down Expand Up @@ -5856,7 +5856,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"inUseHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -5890,7 +5890,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand All @@ -5901,7 +5901,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"lockedHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -5935,7 +5935,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand Down Expand Up @@ -6308,7 +6308,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"inUseHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -6342,7 +6342,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand All @@ -6353,7 +6353,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"lockedHolds": {
"items": {
"properties": {
"created": {
"createdAt": {
"exclusiveMinimum": 0,
"type": "number",
},
Expand Down Expand Up @@ -6387,7 +6387,7 @@ The key is generated by the caller and should be unique for each DTO. You can us
"createdBy",
"instanceId",
"quantity",
"created",
"createdAt",
"expires",
],
"type": "object",
Expand Down
Loading
Loading