Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Multisig Transactions & Application Proposals: Adds metadata to entities #13

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions generated/APTeamMultiSig/APTeamMultiSig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ export class TransactionSubmitted__Params {
get transactionId(): BigInt {
return this._event.parameters[2].value.toBigInt();
}

get metadata(): Bytes {
return this._event.parameters[3].value.toBytes();
}
}

export class APTeamMultiSig__transactionsResult {
Expand Down
48 changes: 2 additions & 46 deletions generated/Accounts/Accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1348,30 +1348,6 @@ export class Accounts__queryConfigResultConfigStruct extends ethereum.Tuple {
get nextAccountId(): BigInt {
return this[4].toBigInt();
}

get maxGeneralCategoryId(): BigInt {
return this[5].toBigInt();
}

get subDao(): Address {
return this[6].toAddress();
}

get earlyLockedWithdrawFee(): Accounts__queryConfigResultConfigEarlyLockedWithdrawFeeStruct {
return changetype<
Accounts__queryConfigResultConfigEarlyLockedWithdrawFeeStruct
>(this[7].toTuple());
}
}

export class Accounts__queryConfigResultConfigEarlyLockedWithdrawFeeStruct extends ethereum.Tuple {
get payoutAddress(): Address {
return this[0].toAddress();
}

get bps(): BigInt {
return this[1].toBigInt();
}
}

export class Accounts__queryEndowmentDetailsResultEndowmentStruct extends ethereum.Tuple {
Expand Down Expand Up @@ -2195,7 +2171,7 @@ export class Accounts extends ethereum.SmartContract {
queryConfig(): Accounts__queryConfigResultConfigStruct {
let result = super.call(
"queryConfig",
"queryConfig():((address,string,string,address,uint256,uint256,address,(address,uint256)))",
"queryConfig():((address,string,string,address,uint256))",
[]
);

Expand All @@ -2209,7 +2185,7 @@ export class Accounts extends ethereum.SmartContract {
> {
let result = super.tryCall(
"queryConfig",
"queryConfig():((address,string,string,address,uint256,uint256,address,(address,uint256)))",
"queryConfig():((address,string,string,address,uint256))",
[]
);
if (result.reverted) {
Expand Down Expand Up @@ -3975,16 +3951,6 @@ export class UpdateConfigCall__Inputs {
get newRegistrar(): Address {
return this._call.inputValues[0].value.toAddress();
}

get maxGeneralCategoryId(): BigInt {
return this._call.inputValues[1].value.toBigInt();
}

get earlyLockedWithdrawFee(): UpdateConfigCallEarlyLockedWithdrawFeeStruct {
return changetype<UpdateConfigCallEarlyLockedWithdrawFeeStruct>(
this._call.inputValues[2].value.toTuple()
);
}
}

export class UpdateConfigCall__Outputs {
Expand All @@ -3995,16 +3961,6 @@ export class UpdateConfigCall__Outputs {
}
}

export class UpdateConfigCallEarlyLockedWithdrawFeeStruct extends ethereum.Tuple {
get payoutAddress(): Address {
return this[0].toAddress();
}

get bps(): BigInt {
return this[1].toBigInt();
}
}

export class UpdateDelegateCall extends ethereum.Call {
get inputs(): UpdateDelegateCall__Inputs {
return new UpdateDelegateCall__Inputs(this);
Expand Down
28 changes: 18 additions & 10 deletions generated/CharityApplications/CharityApplications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export class ApplicationProposed__Params {
get expiry(): BigInt {
return this._event.parameters[3].value.toBigInt();
}

get metadata(): Bytes {
return this._event.parameters[4].value.toBytes();
}
}

export class ApprovalsRequiredChanged extends ethereum.Event {
Expand Down Expand Up @@ -440,6 +444,10 @@ export class TransactionSubmitted__Params {
get transactionId(): BigInt {
return this._event.parameters[2].value.toBigInt();
}

get metadata(): Bytes {
return this._event.parameters[3].value.toBytes();
}
}

export class CharityApplications__configResult {
Expand Down Expand Up @@ -1139,14 +1147,14 @@ export class CharityApplications__proposalsResultApplicationSplitToLiquidStruct
export class CharityApplications__proposalsResult {
value0: Address;
value1: CharityApplications__proposalsResultApplicationStruct;
value2: string;
value2: Bytes;
value3: BigInt;
value4: boolean;

constructor(
value0: Address,
value1: CharityApplications__proposalsResultApplicationStruct,
value2: string,
value2: Bytes,
value3: BigInt,
value4: boolean
) {
Expand All @@ -1161,7 +1169,7 @@ export class CharityApplications__proposalsResult {
let map = new TypedMap<string, ethereum.Value>();
map.set("value0", ethereum.Value.fromAddress(this.value0));
map.set("value1", ethereum.Value.fromTuple(this.value1));
map.set("value2", ethereum.Value.fromString(this.value2));
map.set("value2", ethereum.Value.fromBytes(this.value2));
map.set("value3", ethereum.Value.fromUnsignedBigInt(this.value3));
map.set("value4", ethereum.Value.fromBoolean(this.value4));
return map;
Expand All @@ -1175,7 +1183,7 @@ export class CharityApplications__proposalsResult {
return this.value1;
}

getMeta(): string {
getMetadata(): Bytes {
return this.value2;
}

Expand Down Expand Up @@ -1606,7 +1614,7 @@ export class CharityApplications extends ethereum.SmartContract {
proposals(param0: BigInt): CharityApplications__proposalsResult {
let result = super.call(
"proposals",
"proposals(uint256):(address,(bool,uint256,string,uint256[],uint8,uint8,string,string,address[],uint256,uint256,address[],address[],(address,uint256),(address,uint256),(address,uint256),(address,uint256),uint256,((bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256))),uint32,address[],bool,(uint256,uint256,uint256),uint256),string,uint256,bool)",
"proposals(uint256):(address,(bool,uint256,string,uint256[],uint8,uint8,string,string,address[],uint256,uint256,address[],address[],(address,uint256),(address,uint256),(address,uint256),(address,uint256),uint256,((bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256))),uint32,address[],bool,(uint256,uint256,uint256),uint256),bytes,uint256,bool)",
[ethereum.Value.fromUnsignedBigInt(param0)]
);

Expand All @@ -1615,7 +1623,7 @@ export class CharityApplications extends ethereum.SmartContract {
changetype<CharityApplications__proposalsResultApplicationStruct>(
result[1].toTuple()
),
result[2].toString(),
result[2].toBytes(),
result[3].toBigInt(),
result[4].toBoolean()
);
Expand All @@ -1626,7 +1634,7 @@ export class CharityApplications extends ethereum.SmartContract {
): ethereum.CallResult<CharityApplications__proposalsResult> {
let result = super.tryCall(
"proposals",
"proposals(uint256):(address,(bool,uint256,string,uint256[],uint8,uint8,string,string,address[],uint256,uint256,address[],address[],(address,uint256),(address,uint256),(address,uint256),(address,uint256),uint256,((bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256))),uint32,address[],bool,(uint256,uint256,uint256),uint256),string,uint256,bool)",
"proposals(uint256):(address,(bool,uint256,string,uint256[],uint8,uint8,string,string,address[],uint256,uint256,address[],address[],(address,uint256),(address,uint256),(address,uint256),(address,uint256),uint256,((bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256)),(bool,(address,uint256))),uint32,address[],bool,(uint256,uint256,uint256),uint256),bytes,uint256,bool)",
[ethereum.Value.fromUnsignedBigInt(param0)]
);
if (result.reverted) {
Expand All @@ -1639,7 +1647,7 @@ export class CharityApplications extends ethereum.SmartContract {
changetype<CharityApplications__proposalsResultApplicationStruct>(
value[1].toTuple()
),
value[2].toString(),
value[2].toBytes(),
value[3].toBigInt(),
value[4].toBoolean()
)
Expand Down Expand Up @@ -2251,8 +2259,8 @@ export class ProposeApplicationCall__Inputs {
);
}

get _meta(): string {
return this._call.inputValues[1].value.toString();
get _metadata(): Bytes {
return this._call.inputValues[1].value.toBytes();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ export class TransactionSubmitted__Params {
get transactionId(): BigInt {
return this._event.parameters[2].value.toBigInt();
}

get metadata(): Bytes {
return this._event.parameters[3].value.toBytes();
}
}

export class EndowmentMultiSigEmitter extends ethereum.SmartContract {
Expand Down Expand Up @@ -810,6 +814,10 @@ export class TransactionSubmittedEndowmentCall__Inputs {
get transactionId(): BigInt {
return this._call.inputValues[2].value.toBigInt();
}

get metadata(): Bytes {
return this._call.inputValues[3].value.toBytes();
}
}

export class TransactionSubmittedEndowmentCall__Outputs {
Expand Down
26 changes: 26 additions & 0 deletions generated/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,19 @@ export class MultiSigTransaction extends Entity {
this.set("expiry", Value.fromBigInt(value));
}

get metadata(): Bytes {
let value = this.get("metadata");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}

set metadata(value: Bytes) {
this.set("metadata", Value.fromBytes(value));
}

get blockTimestamp(): BigInt {
let value = this.get("blockTimestamp");
if (!value || value.kind == ValueKind.NULL) {
Expand Down Expand Up @@ -568,6 +581,19 @@ export class ApplicationProposal extends Entity {
this.set("expiry", Value.fromBigInt(value));
}

get metadata(): Bytes {
let value = this.get("metadata");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}

set metadata(value: Bytes) {
this.set("metadata", Value.fromBytes(value));
}

get blockTimestamp(): BigInt {
let value = this.get("blockTimestamp");
if (!value || value.kind == ValueKind.NULL) {
Expand Down
2 changes: 2 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type MultiSigTransaction @entity {
proposer: User!
executed: Boolean!
expiry: BigInt!
metadata: Bytes!
blockTimestamp: BigInt!
confirmations: [TransactionConfirmation!]! @derivedFrom(field: "transaction")
}
Expand All @@ -61,6 +62,7 @@ type ApplicationProposal @entity {
charityName: String!
proposer: User!
expiry: BigInt!
metadata: Bytes!
blockTimestamp: BigInt!
confirmations: [ApplicationConfirmation]! @derivedFrom(field: "proposal")
}
Expand Down
1 change: 1 addition & 0 deletions src/ap-team-multi-sig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export function handleTransactionSubmitted(
tx.proposer = event.params.sender
tx.executed = (ms.approvalsRequired < BigInt.fromI32(1) || ms.requireExecution) ? false : true
tx.expiry = event.block.timestamp.plus(ms.transactionExpiry)
tx.metadata = event.params.metadata
tx.blockTimestamp = event.block.timestamp
tx.save()
}
Expand Down
2 changes: 2 additions & 0 deletions src/charity-applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export function handleTransactionSubmitted(
tx.proposer = event.params.sender
tx.executed = (ms.approvalsRequired < BigInt.fromI32(1) || ms.requireExecution) ? false : true
tx.expiry = event.block.timestamp.plus(ms.transactionExpiry)
tx.metadata = event.params.metadata
tx.blockTimestamp = event.block.timestamp
tx.save()
}
Expand Down Expand Up @@ -201,6 +202,7 @@ export function handleApplicationProposed(
proposal.proposer = event.params.proposer
proposal.executed = false
proposal.expiry = event.params.expiry
proposal.metadata = event.params.metadata
proposal.blockTimestamp = event.block.timestamp
proposal.save()
}
Expand Down
1 change: 1 addition & 0 deletions src/endowment-multi-sig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export function handleTransactionSubmitted(
tx.proposer = event.params.owner
tx.executed = (ms.approvalsRequired < BigInt.fromI32(1) || ms.requireExecution) ? false : true
tx.expiry = event.block.timestamp.plus(ms.transactionExpiry)
tx.metadata = event.params.metadata
tx.blockTimestamp = event.block.timestamp
tx.save()
}
Expand Down
18 changes: 9 additions & 9 deletions subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ dataSources:
name: Accounts
network: mumbai
source:
address: "0xE2e48880d780c4Fa36655EC9014DBbdA1164C0cA"
address: "0xDC17A0fde92737C58DEE41053cb27EcC0AcAB13e"
abi: Accounts
startBlock: 37910000
startBlock: 38282745
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down Expand Up @@ -45,7 +45,7 @@ dataSources:
source:
address: "0x9034E5Bb0e03c985952C3506363Fe936c4A799f5"
abi: APTeamMultiSig
startBlock: 38254206
startBlock: 38283162
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down Expand Up @@ -74,7 +74,7 @@ dataSources:
handler: handleOwnersRemoved
- event: OwnerReplaced(address,address,address)
handler: handleOwnerReplaced
- event: TransactionSubmitted(address,address,uint256)
- event: TransactionSubmitted(address,address,uint256,bytes)
handler: handleTransactionSubmitted
- event: TransactionConfirmed(address,address,uint256)
handler: handleTransactionConfirmed
Expand All @@ -89,7 +89,7 @@ dataSources:
source:
address: "0xbF338a5f1030c9c3c7d729214A0299201149146C"
abi: CharityApplications
startBlock: 38254158
startBlock: 38283231
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down Expand Up @@ -120,7 +120,7 @@ dataSources:
handler: handleOwnersRemoved
- event: OwnerReplaced(address,address,address)
handler: handleOwnerReplaced
- event: TransactionSubmitted(address,address,uint256)
- event: TransactionSubmitted(address,address,uint256,bytes)
handler: handleTransactionSubmitted
- event: TransactionConfirmed(address,address,uint256)
handler: handleTransactionConfirmed
Expand All @@ -134,7 +134,7 @@ dataSources:
handler: handleApplicationConfirmed
- event: ApplicationExecuted(uint256)
handler: handleApplicationExecuted
- event: ApplicationProposed(uint256,address,string,uint256)
- event: ApplicationProposed(uint256,address,string,uint256,bytes)
handler: handleApplicationProposed
file: ./src/charity-applications.ts
- kind: ethereum
Expand All @@ -143,7 +143,7 @@ dataSources:
source:
address: "0x8a87385765871bD85d96B7675A3F1Fb663146E4d"
abi: EndowmentMultiSigEmitter
startBlock: 38000000
startBlock: 38283268
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -170,7 +170,7 @@ dataSources:
handler: handleOwnersAdded
- event: OwnersRemoved(uint256,address[])
handler: handleOwnersRemoved
- event: TransactionSubmitted(uint256,address,uint256)
- event: TransactionSubmitted(uint256,address,uint256,bytes)
handler: handleTransactionSubmitted
- event: TransactionConfirmed(uint256,address,uint256)
handler: handleTransactionConfirmed
Expand Down