diff --git a/docs/design/cl-registry.md b/docs/design/cl-registry.md index 54b1575a..5461ef30 100644 --- a/docs/design/cl-registry.md +++ b/docs/design/cl-registry.md @@ -51,11 +51,11 @@ Contract name: **SchemaRegistry** #### Create a new schema * Method: `createSchema` - * Description: Transaction to create a new AnonCreds Schema + * Description: Transaction to create a new AnonCreds Schema matching to the [specification](https://hyperledger.github.io/anoncreds-spec/#schema-publisher-publish-schema-object) * Parameters: * `identity` - Account address of schema issuer * `id` - KECCAK256 hash of schema id to be created - * `schema` - AnonCreds schema object as bytes + * `schema` - AnonCreds Schema object as bytes * Restrictions: * Schema id must be unique. * Corresponding issuer account must exist and owned by sender. @@ -172,7 +172,7 @@ Contract name: **CredentialDefinitionRegistry** #### Create a new credential definition * Method: `createCredentialDefinition` - * Description: Transaction to create a new AnonCreds Credential Definition + * Description: Transaction to create a new AnonCreds Credential Definition matching to the [specification](https://hyperledger.github.io/anoncreds-spec/#generating-a-credential-definition-without-revocation-support) * Parameters: * `identity` - Account address of credential definition issuer * `id` - KECCAK256 hash of credential definition id to be created diff --git a/docs/design/endorsement.md b/docs/design/endorsement.md index ed1b60f7..b5bdba0d 100644 --- a/docs/design/endorsement.md +++ b/docs/design/endorsement.md @@ -4,103 +4,6 @@ Not all identity owners may have permissions for writing transactions on the led The goal of this document to define a mechanism of doing transaction writes to the ledger by a special parties having an Endorser role with preserving of original author as an entity owner. -### DID Indy registry - -#### Flow - -* Author steps: - * Step 1: Prepares a DID Document object - * Step 2: Queries `nonce` from the ledger: `IndyDidRegistry.nonce(identity)` - * Step 3: Execute VDR method to calculate hash need to be signed - contract signed data according - to [EIP](https://eips.ethereum.org/EIPS/eip-191). - ``` - keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), nonce[identity], identity, "createDid", did, document)) - // Arguments when calculating hash to validate - // 1: byte(0x19) - the initial 0x19 byte - // 2: byte(0) - the version byte - // 3: address(this) - the validator address - // 4-8: Application specific data - // nonce - nonce to prevent reply attack - // identity - author account address - // `createDid` original contract method - added to be aligned with did:ethr contract - // did - DID to be created - // document - DID document as JSON string - ``` - * Step 4: Performs EcDSA signing using his ethereum identity account keys - * Step 5: Passes DID Document and Signature to Endorser -* Endorser steps: - * Step 1: Endorser builds transaction to endorse - DID: `endorseDid(address identity, string did, string document, uint8 sigV, bytes32 sigR, bytes32 sigS)` - > Optionally: `identity` can be derived from DidDocument.id instead of passing explicitly - * Step 2: Endorser does regular EcDSA signing of the **Transaction** - * Step 3: Endorser submit the signed transaction to the ledger which executes deployed `IndyDidRegistry.endorseDid` - contract method -* Ethereum: - * Checks the validity of the transaction level signature (Endorser's signature) -* Contract: - * Step 1: Get current nonce value of identity - * Step 2: Calculate the hash of signed data: same as for Author Step 3 - * Step 3: Checks the validity of the provided signature against identity passed as the parameter `ecrecover(...);` - * `ecrecover` returns an account signed the message - -#### Contracts - -``` -mapping(address => uint) public nonce; - -// identity - ethereum address of DID owner -// document - did document -// identitySignature - identity owner signatures (EcDSA and optionally ED25519) ower serialized DID Document -function endorseDid(address identity, string calldata did, string calldata document, uint8 sigV, bytes32 sigR, bytes32 sigS) { - // sender is endorser when it's not equal to identity - if (msg.sender == identity) { - revert InvalidmethodExecution; - } - - // calculate the hash of DiDocument - // this hash will be checked agains signatures to verify ownership - bytes32 hash = keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), nonce[identity], identity, "createDid", did, document)); - - // verify EcDSA identity owner signature ower DID + DidDocument - checkEcDsaSignature(identity, hash, identitySignature); - - nonce[identity]++; - record[didDocument.did].didDocument = didDocument - record[didDocument.did].metadata.owner = identity - record[didDocument.did].metadata.sender = msg.sender -} - -function checkEcDsaSignature(address identity, bytes32 hash, EcDSASignature signature) { - address signer = ecrecover(hash, signature.v, signature.r, signature.s); - if (signer == address(0)) { - revert InvalidSignature("Invalid signature provided"); - } - if (identity != signer) { - revert InvalidSignature("Signature does not match to the target identity"); - } -} -``` - -#### VDR - -```rust -// Prepare endorsing bytes which need to be signed by an identity owner -fn prepare_endorse_did_data( - client: &LedgerClient, - identity: &Address, - did_doc: DidDocument -) -> Vec; - -// Build transaction to endorse DID -fn build_endorse_did_transaction( - client: &LedgerClient, - sender: &Address, - identity: &Address, - did_doc: &DidDocument, - signature: &Signature -) -> VdrResult {} -``` - ### DID Ethr registry `did:ethr` allows using Ethereum addresses as identifier without prior its registration on the network. @@ -133,6 +36,8 @@ TO BE defined later. **Schema endorsing steps** +Endorsing for schemas and credential definition is designed to match existing `did:ethr` API. + > In case of Schema and Credential Definition we do not need to add `nonce` as we do not have an update operation. * Author steps: @@ -140,23 +45,22 @@ TO BE defined later. * Step 2: Execute VDR method to calculate hash need to be signed - contract signed data according to [EIP](https://eips.ethereum.org/EIPS/eip-191). ``` - keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createSchema", id, issuerId, schema)) + keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createSchema", id, schema)) // Arguments when calculating hash to validate // 1: byte(0x19) - the initial 0x19 byte // 2: byte(0) - the version byte // 3: address(this) - the validator address - // 4-8: Application specific data + // 4-7: Application specific data // identity - author account address // `createSchema` original contract method - added to be aligned with did:ethr contract // id - id of schema to be created - // issuerId - id of schema issuer // schema - schema as JSON string ``` * Step 3: Performs EcDSA signing using his ethereum identity account keys * Step 4: Author passes Schema and Signature to Endorser * Endorser steps: * Step 1: Endorser builds transaction to endorse - DID: `endorseSchema(address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, string id, string issuerId, string schema)` + DID: `endorseSchema(address identity, uint8 sigV, bytes32 sigR, bytes32 sigS, bytes32 id, bytes schema)` * Step 2: Endorser does regular EcDSA signing of the **Transaction** * Step 3: Endorser submit the signed transaction to the ledger which executes deployed `SchemaRegistry.endorseSchema` @@ -178,16 +82,15 @@ TO BE defined later. * Step 2: Execute VDR method to calculate hash need to be signed - contract signed data according to [EIP](https://eips.ethereum.org/EIPS/eip-191). ``` - keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createCredentialDefinition", id, issuerId, schemaId, credDef)) + keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createCredentialDefinition", id, schemaId, credDef)) // Arguments when calculating hash to validate // 1: byte(0x19) - the initial 0x19 byte // 2: byte(0) - the version byte // 3: address(this) - the validator address - // 4-9: Application specific data + // 4-8: Application specific data // identity - author account address // `createSchema` original contract method - added to be aligned with did:ethr contract // id - id of schema to be created - // issuerId - id of issuer // schemaId - id of schema // credDef - credential definition as JSON string ``` @@ -198,39 +101,38 @@ TO BE defined later. #### Contracts ``` -function endorseSchema( +function createSchemaSigned( address identity, - string calldata id, - string calldata issuerId, - string calldata schema, uint8 sigV, bytes32 sigR, bytes32 sigS + bytes32 id, + bytes schema, + ) public virtual { // validate identity signature - bytes32 hash = keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createSchema", id, issuerId, schema)); + bytes32 hash = keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createSchema", id, schema)); checkSignature(identity, hash, sigV, sigR, sigS); // store schema - createSchema(identity, id, issuerId, schema); + createSchema(identity, id, schema); } function endorseCredentialDefinition( address identity, - string memory id, - string calldata issuerId, - string calldata schemaId, - string memory credDef, uint8 sigV, bytes32 sigR, - bytes32 sigS + bytes32 sigS, + byets32 id, + byets32 schemaId, + byets credDef ) public virtual { // validate identity signature - bytes32 hash = keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createCredentialDefinition", id, issuerId, schemaId, credDef)); + bytes32 hash = keccak256(abi.encodePacked(bytes1(0x19), bytes1(0), address(this), identity, "createCredentialDefinition", id, schemaId, credDef)); checkSignature(identity, hash, sigV, sigR, sigS); // store credential definition - createCredentialDefinition_(identity, id, issuerId, schemaId, credDef); + createCredentialDefinition_(identity, id, schemaId, credDef); } ``` @@ -238,45 +140,35 @@ function endorseCredentialDefinition( ```rust // Prepare schema endorsing bytes which need to be signed by an identity owner -fn prepare_endorse_schema_data( +pub async fn build_create_schema_endorsing_data( client: &LedgerClient, - identity: &Address, id: &SchemaId, - issuer_id: &DID, schema: &Schema, -) -> Vec; +) -> VdrResult; // Build transaction to endorse Schema -fn build_endorse_schema_transaction( +pub async fn build_create_schema_signed_transaction( client: &LedgerClient, sender: &Address, - identity: &Address, id: &SchemaId, - issuer_id: &DID, schema: &Schema, - signature: &Signature -) -> VdrResult {} + signature: &SignatureData, +) -> VdrResult; // Prepare credential definition endorsing bytes which need to be signed by an identity owner -fn prepare_endorse_credential_definition_data( +pub async fn build_create_credential_definition_endorsing_data( client: &LedgerClient, - identity: &Address, - id: &SchemaId, - issuer_id: &DID, - schema_id: &SchemaId, - cred_def: &CredentialDefinition, -) -> Vec; + id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, +) -> VdrResult; // Build transaction to endorse CredentialDefinition -fn build_endorse_credential_definition_transaction( +pub async fn build_create_credential_definition_signed_transaction( client: &LedgerClient, - sender: &Address, - identity: &Address, - id: &SchemaId, - issuer_id: &DID, - schema_id: &SchemaId, - cred_def: &CredentialDefinition, - signature: &Signature -) -> VdrResult {} + from: &Address, + id: &CredentialDefinitionId, + credential_definition: &CredentialDefinition, + signature: &SignatureData, +) -> VdrResult; ``` diff --git a/network/config/besu/genesis.json b/network/config/besu/genesis.json index 9ffdbb7f..29c74459 100644 --- a/network/config/besu/genesis.json +++ b/network/config/besu/genesis.json @@ -175,13 +175,13 @@ "0000000000000000000000000000000000000000000000000000000000000000": "0x0000000000000000000000000000000000000000000000000000000000009999", "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000018888", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000a3f794638578ed0b3abcea8482f5a4454ebd7293" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x0000000000000000000000002d8ef83a48caa0366b27021d47d8bb9f7d02016d" } }, - "0xa3f794638578ed0b3abcea8482f5a4454ebd7293": { + "0x2d8ef83a48caa0366b27021d47d8bb9f7d02016d": { "comment": "Implementation: Smart contract to manage schemas", "balance": "0", - "code": "0x60806040526004361061007b5760003560e01c8063ad3cb1cc1161004e578063ad3cb1cc146100fd578063bdd23ccb1461013b578063e8d740291461015b578063eaa760c21461019a57600080fd5b8063485cc955146100805780634f1ef286146100a257806352d1902d146100b55780635915b768146100dd575b600080fd5b34801561008c57600080fd5b506100a061009b3660046109e7565b6101c7565b005b6100a06100b0366004610a36565b6102c8565b3480156100c157600080fd5b506100ca6102e7565b6040519081526020015b60405180910390f35b3480156100e957600080fd5b506100a06100f8366004610b43565b610304565b34801561010957600080fd5b5061012e604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100d49190610bc3565b34801561014757600080fd5b506100a0610156366004610bf6565b610317565b34801561016757600080fd5b5061018a610176366004610c82565b600090815260026020526040902054151590565b60405190151581526020016100d4565b3480156101a657600080fd5b506100ca6101b5366004610c82565b60026020526000908152604090205481565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806102115750805467ffffffffffffffff808416911610155b1561022f5760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b17815561025a84610376565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b6102d06103a0565b6102d982610447565b6102e382826104ad565b5050565b60006102f1610574565b50600080516020610da083398151915290565b61031184338585856105bd565b50505050565b60405160009061033b90601960f81b90839030908c90899089908990602001610c9b565b60405160208183030381529060405280519060200120905061036c886103648a848b8b8b6106fd565b8686866105bd565b5050505050505050565b61037e6107ae565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061042757507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661041b600080516020610da0833981519152546001600160a01b031690565b6001600160a01b031614155b156104455760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561049257600080fd5b505afa1580156104a6573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015610507575060408051601f3d908101601f1916820190925261050491810190610d0d565b60015b61053457604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610da0833981519152811461056557604051632a87526960e21b81526004810182905260240161052b565b61056f83836107f7565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104455760405163703e46dd60e11b815260040160405180910390fd5b6000838152600260205260409020548390156105ef576040516347f6332960e11b81526004810182905260240161052b565b6001546040516310e67a9d60e31b81526001600160a01b03808916600483015288928892911690638733d4e890602401602060405180830381865afa15801561063c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106609190610d26565b6001600160a01b0316816001600160a01b0316146106a45760405163cc41100960e01b81526001600160a01b0380841660048301528216602482015260440161052b565b600086815260026020526040908190204390555186907f3e21fe65ee16f151c8cda6e871883b2e0550f9c8511b4ea1d75c9c9e8d489f67906106eb908a9089908990610d43565b60405180910390a25050505050505050565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa158015610753573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b0316146107a45760405163cc41100960e01b81526001600160a01b0380891660048301528216602482015260440161052b565b9695505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661044557604051631afcd79f60e31b815260040160405180910390fd5b6108008261084d565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156108455761056f82826108b2565b6102e3610928565b806001600160a01b03163b60000361088357604051634c9c8ce360e01b81526001600160a01b038216600482015260240161052b565b600080516020610da083398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516108cf9190610d83565b600060405180830381855af49150503d806000811461090a576040519150601f19603f3d011682016040523d82523d6000602084013e61090f565b606091505b509150915061091f858383610947565b95945050505050565b34156104455760405163b398979f60e01b815260040160405180910390fd5b60608261095c57610957826109a6565b61099f565b815115801561097357506001600160a01b0384163b155b1561099c57604051639996b31560e01b81526001600160a01b038516600482015260240161052b565b50805b9392505050565b8051156109b65780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b03811681146109cf57600080fd5b600080604083850312156109fa57600080fd5b8235610a05816109d2565b91506020830135610a15816109d2565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610a4957600080fd5b8235610a54816109d2565b9150602083013567ffffffffffffffff80821115610a7157600080fd5b818501915085601f830112610a8557600080fd5b813581811115610a9757610a97610a20565b604051601f8201601f19908116603f01168101908382118183101715610abf57610abf610a20565b81604052828152886020848701011115610ad857600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f840112610b0c57600080fd5b50813567ffffffffffffffff811115610b2457600080fd5b602083019150836020828501011115610b3c57600080fd5b9250929050565b60008060008060608587031215610b5957600080fd5b8435610b64816109d2565b935060208501359250604085013567ffffffffffffffff811115610b8757600080fd5b610b9387828801610afa565b95989497509550505050565b60005b83811015610bba578181015183820152602001610ba2565b50506000910152565b6020815260008251806020840152610be2816040850160208701610b9f565b601f01601f19169190910160400192915050565b600080600080600080600060c0888a031215610c1157600080fd5b8735610c1c816109d2565b9650602088013560ff81168114610c3257600080fd5b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115610c6357600080fd5b610c6f8a828b01610afa565b989b979a50959850939692959293505050565b600060208284031215610c9457600080fd5b5035919050565b6001600160f81b03198881168252871660018201526bffffffffffffffffffffffff19606087811b8216600284015286901b1660168201526b637265617465536368656d6160a01b602a8201526036810184905260008284605684013750600091016056019081529695505050505050565b600060208284031215610d1f57600080fd5b5051919050565b600060208284031215610d3857600080fd5b815161099f816109d2565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610d95818460208701610b9f565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212204a4fb68df29ffd4bbbd06a3c0b087236a2b91e6a775ec5d620b345da38d3139664736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c80635915b7681161004e5780635915b768146100d2578063ad3cb1cc146100f2578063bdd23ccb14610130578063eaa760c21461015057600080fd5b8063485cc955146100755780634f1ef2861461009757806352d1902d146100aa575b600080fd5b34801561008157600080fd5b5061009561009036600461099d565b61017d565b005b6100956100a53660046109ec565b61027e565b3480156100b657600080fd5b506100bf61029d565b6040519081526020015b60405180910390f35b3480156100de57600080fd5b506100956100ed366004610af9565b6102ba565b3480156100fe57600080fd5b50610123604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100c99190610b79565b34801561013c57600080fd5b5061009561014b366004610bac565b6102cd565b34801561015c57600080fd5b506100bf61016b366004610c38565b60026020526000908152604090205481565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806101c75750805467ffffffffffffffff808416911610155b156101e55760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556102108461032c565b600180546001600160a01b0319166001600160a01b038516179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a150505050565b610286610356565b61028f826103fd565b6102998282610463565b5050565b60006102a761052a565b50600080516020610d5683398151915290565b6102c78433858585610573565b50505050565b6040516000906102f190601960f81b90839030908c90899089908990602001610c51565b6040516020818303038152906040528051906020012090506103228861031a8a848b8b8b6106b3565b868686610573565b5050505050505050565b610334610764565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103dd57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103d1600080516020610d56833981519152546001600160a01b031690565b6001600160a01b031614155b156103fb5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561044857600080fd5b505afa15801561045c573d6000803e3d6000fd5b5050505050565b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104bd575060408051601f3d908101601f191682019092526104ba91810190610cc3565b60015b6104ea57604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610d56833981519152811461051b57604051632a87526960e21b8152600481018290526024016104e1565b61052583836107ad565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103fb5760405163703e46dd60e11b815260040160405180910390fd5b6000838152600260205260409020548390156105a5576040516347f6332960e11b8152600481018290526024016104e1565b6001546040516310e67a9d60e31b81526001600160a01b03808916600483015288928892911690638733d4e890602401602060405180830381865afa1580156105f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106169190610cdc565b6001600160a01b0316816001600160a01b03161461065a5760405163cc41100960e01b81526001600160a01b038084166004830152821660248201526044016104e1565b600086815260026020526040908190204390555186907f3e21fe65ee16f151c8cda6e871883b2e0550f9c8511b4ea1d75c9c9e8d489f67906106a1908a9089908990610cf9565b60405180910390a25050505050505050565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa158015610709573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b03161461075a5760405163cc41100960e01b81526001600160a01b038089166004830152821660248201526044016104e1565b9695505050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103fb57604051631afcd79f60e31b815260040160405180910390fd5b6107b682610803565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156107fb576105258282610868565b6102996108de565b806001600160a01b03163b60000361083957604051634c9c8ce360e01b81526001600160a01b03821660048201526024016104e1565b600080516020610d5683398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b0316846040516108859190610d39565b600060405180830381855af49150503d80600081146108c0576040519150601f19603f3d011682016040523d82523d6000602084013e6108c5565b606091505b50915091506108d58583836108fd565b95945050505050565b34156103fb5760405163b398979f60e01b815260040160405180910390fd5b6060826109125761090d8261095c565b610955565b815115801561092957506001600160a01b0384163b155b1561095257604051639996b31560e01b81526001600160a01b03851660048201526024016104e1565b50805b9392505050565b80511561096c5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b038116811461098557600080fd5b600080604083850312156109b057600080fd5b82356109bb81610988565b915060208301356109cb81610988565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156109ff57600080fd5b8235610a0a81610988565b9150602083013567ffffffffffffffff80821115610a2757600080fd5b818501915085601f830112610a3b57600080fd5b813581811115610a4d57610a4d6109d6565b604051601f8201601f19908116603f01168101908382118183101715610a7557610a756109d6565b81604052828152886020848701011115610a8e57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60008083601f840112610ac257600080fd5b50813567ffffffffffffffff811115610ada57600080fd5b602083019150836020828501011115610af257600080fd5b9250929050565b60008060008060608587031215610b0f57600080fd5b8435610b1a81610988565b935060208501359250604085013567ffffffffffffffff811115610b3d57600080fd5b610b4987828801610ab0565b95989497509550505050565b60005b83811015610b70578181015183820152602001610b58565b50506000910152565b6020815260008251806020840152610b98816040850160208701610b55565b601f01601f19169190910160400192915050565b600080600080600080600060c0888a031215610bc757600080fd5b8735610bd281610988565b9650602088013560ff81168114610be857600080fd5b955060408801359450606088013593506080880135925060a088013567ffffffffffffffff811115610c1957600080fd5b610c258a828b01610ab0565b989b979a50959850939692959293505050565b600060208284031215610c4a57600080fd5b5035919050565b6001600160f81b03198881168252871660018201526bffffffffffffffffffffffff19606087811b8216600284015286901b1660168201526b637265617465536368656d6160a01b602a8201526036810184905260008284605684013750600091016056019081529695505050505050565b600060208284031215610cd557600080fd5b5051919050565b600060208284031215610cee57600080fd5b815161095581610988565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610d4b818460208701610b55565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca264697066735822122004327f7acb789b0212fc0886f4f174a5f4b4b46a13dbbb20db5383f95211b15d64736f6c63430008170033" }, "0x0000000000000000000000000000000000004444": { "comment": "Proxy: Smart contract to manage credential definitions", @@ -192,13 +192,13 @@ "0000000000000000000000000000000000000000000000000000000000000001": "0x0000000000000000000000000000000000000000000000000000000000018888", "0000000000000000000000000000000000000000000000000000000000000002": "0x0000000000000000000000000000000000000000000000000000000000005555", "f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00": "0x0000000000000000000000000000000000000000000000000000000000000001", - "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000ddbc94cbc03d53bdaff95115dacd7101805e2179" + "360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x00000000000000000000000097fa08cd747ea254194e6ed783126688b7b955d7" } }, - "0xddbc94cbc03d53bdaff95115dacd7101805e2179": { + "0x97fa08cd747ea254194e6ed783126688b7b955d7": { "comment": "Implementation: Smart contract to manage credential definitions", "balance": "0", - "code": "0x60806040526004361061007b5760003560e01c8063bbc742411161004e578063bbc742411461013a578063c0c53b8b1461015a578063eaa760c21461017a578063f062236b146101a757600080fd5b80634f1ef2861461008057806352d1902d146100955780638b963e9d146100bd578063ad3cb1cc146100fc575b600080fd5b61009361008e366004610aa8565b6101c7565b005b3480156100a157600080fd5b506100aa6101e6565b6040519081526020015b60405180910390f35b3480156100c957600080fd5b506100ec6100d8366004610b6c565b600090815260036020526040902054151590565b60405190151581526020016100b4565b34801561010857600080fd5b5061012d604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100b49190610ba9565b34801561014657600080fd5b50610093610155366004610c25565b610203565b34801561016657600080fd5b50610093610175366004610c8f565b610218565b34801561018657600080fd5b506100aa610195366004610b6c565b60036020526000908152604090205481565b3480156101b357600080fd5b506100936101c2366004610cda565b61032f565b6101cf610392565b6101d882610439565b6101e28282610498565b5050565b60006101f061055f565b50600080516020610eaf83398151915290565b6102118533868686866105a8565b5050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806102625750805467ffffffffffffffff808416911610155b156102805760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b1781556102ab8561077e565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60405160009061035590601960f81b90839030908d908a908a908a908a90602001610d6f565b6040516020818303038152906040528051906020012090506103878961037e8b848c8c8c6107a8565b878787876105a8565b505050505050505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148061041957507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661040d600080516020610eaf833981519152546001600160a01b031690565b6001600160a01b031614155b156104375760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561048457600080fd5b505afa158015610211573d6000803e3d6000fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104f2575060408051601f3d908101601f191682019092526104ef91810190610dfa565b60015b61051f57604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610eaf833981519152811461055057604051632a87526960e21b815260048101829052602401610516565b61055a8383610859565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146104375760405163703e46dd60e11b815260040160405180910390fd5b6000848152600360205260409020548490156105da5760405163b1a7a2af60e01b815260048101829052602401610516565b6001546040516310e67a9d60e31b81526001600160a01b03808a16600483015289928992911690638733d4e890602401602060405180830381865afa158015610627573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064b9190610e13565b6001600160a01b0316816001600160a01b03161461068f5760405163cc41100960e01b81526001600160a01b03808416600483015282166024820152604401610516565b60025460405163e8d7402960e01b81526004810188905287916001600160a01b03169063e8d74029906024016020604051808303816000875af11580156106da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fe9190610e30565b15156000036107235760405163063de83560e21b815260048101829052602401610516565b600088815260036020526040908190204390555188907fb244582b6218e1202021c674f5f9ba330f9393f8359101bb96445efeedff3db39061076a908c908a908a90610e52565b60405180910390a250505050505050505050565b6107866108af565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa1580156107fe573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b03161461084f5760405163cc41100960e01b81526001600160a01b03808916600483015282166024820152604401610516565b9695505050505050565b610862826108f8565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156108a75761055a828261095d565b6101e26109d3565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661043757604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b60000361092e57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610516565b600080516020610eaf83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161097a9190610e92565b600060405180830381855af49150503d80600081146109b5576040519150601f19603f3d011682016040523d82523d6000602084013e6109ba565b606091505b50915091506109ca8583836109f2565b95945050505050565b34156104375760405163b398979f60e01b815260040160405180910390fd5b606082610a0757610a0282610a51565b610a4a565b8151158015610a1e57506001600160a01b0384163b155b15610a4757604051639996b31560e01b81526001600160a01b0385166004820152602401610516565b50805b9392505050565b805115610a615780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b0381168114610a7a57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610abb57600080fd5b8235610ac681610a7d565b9150602083013567ffffffffffffffff80821115610ae357600080fd5b818501915085601f830112610af757600080fd5b813581811115610b0957610b09610a92565b604051601f8201601f19908116603f01168101908382118183101715610b3157610b31610a92565b81604052828152886020848701011115610b4a57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b600060208284031215610b7e57600080fd5b5035919050565b60005b83811015610ba0578181015183820152602001610b88565b50506000910152565b6020815260008251806020840152610bc8816040850160208701610b85565b601f01601f19169190910160400192915050565b60008083601f840112610bee57600080fd5b50813567ffffffffffffffff811115610c0657600080fd5b602083019150836020828501011115610c1e57600080fd5b9250929050565b600080600080600060808688031215610c3d57600080fd5b8535610c4881610a7d565b94506020860135935060408601359250606086013567ffffffffffffffff811115610c7257600080fd5b610c7e88828901610bdc565b969995985093965092949392505050565b600080600060608486031215610ca457600080fd5b8335610caf81610a7d565b92506020840135610cbf81610a7d565b91506040840135610ccf81610a7d565b809150509250925092565b60008060008060008060008060e0898b031215610cf657600080fd5b8835610d0181610a7d565b9750602089013560ff81168114610d1757600080fd5b965060408901359550606089013594506080890135935060a0890135925060c089013567ffffffffffffffff811115610d4f57600080fd5b610d5b8b828c01610bdc565b999c989b5096995094979396929594505050565b6001600160f81b03198981168252881660018201526bffffffffffffffffffffffff19606088811b8216600284015287901b1660168201527f63726561746543726564656e7469616c446566696e6974696f6e000000000000602a82015260448101859052606481018490526000828460848401375060009101608401908152979650505050505050565b600060208284031215610e0c57600080fd5b5051919050565b600060208284031215610e2557600080fd5b8151610a4a81610a7d565b600060208284031215610e4257600080fd5b81518015158114610a4a57600080fd5b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610ea4818460208701610b85565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201f00954ebf639fab6f5f5c206581348f7c25f754c1b3e5049cc5d0dce01f676864736f6c63430008170033" + "code": "0x6080604052600436106100705760003560e01c8063bbc742411161004e578063bbc74241146100f0578063c0c53b8b14610110578063eaa760c214610130578063f062236b1461015d57600080fd5b80634f1ef2861461007557806352d1902d1461008a578063ad3cb1cc146100b2575b600080fd5b610088610083366004610a5c565b61017d565b005b34801561009657600080fd5b5061009f61019c565b6040519081526020015b60405180910390f35b3480156100be57600080fd5b506100e3604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100a99190610b44565b3480156100fc57600080fd5b5061008861010b366004610bc0565b6101b9565b34801561011c57600080fd5b5061008861012b366004610c2a565b6101ce565b34801561013c57600080fd5b5061009f61014b366004610c75565b60036020526000908152604090205481565b34801561016957600080fd5b50610088610178366004610c8e565b6102e5565b610185610348565b61018e826103ef565b610198828261044e565b5050565b60006101a6610515565b50600080516020610e4183398151915290565b6101c785338686868661055e565b5050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805460019190600160401b900460ff16806102185750805467ffffffffffffffff808416911610155b156102365760405163f92ee8a960e01b815260040160405180910390fd5b805468ffffffffffffffffff191667ffffffffffffffff831617600160401b17815561026185610732565b600180546001600160a01b038681166001600160a01b0319928316179092556002805492861692909116919091179055805468ff00000000000000001916815560405167ffffffffffffffff831681527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b60405160009061030b90601960f81b90839030908d908a908a908a908a90602001610d23565b60405160208183030381529060405280519060200120905061033d896103348b848c8c8c61075c565b8787878761055e565b505050505050505050565b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614806103cf57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166103c3600080516020610e41833981519152546001600160a01b031690565b6001600160a01b031614155b156103ed5760405163703e46dd60e11b815260040160405180910390fd5b565b60005460405163574a81d760e01b81523060048201526001600160a01b0383811660248301529091169063574a81d79060440160006040518083038186803b15801561043a57600080fd5b505afa1580156101c7573d6000803e3d6000fd5b816001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156104a8575060408051601f3d908101601f191682019092526104a591810190610dae565b60015b6104d557604051634c9c8ce360e01b81526001600160a01b03831660048201526024015b60405180910390fd5b600080516020610e41833981519152811461050657604051632a87526960e21b8152600481018290526024016104cc565b610510838361080d565b505050565b306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103ed5760405163703e46dd60e11b815260040160405180910390fd5b6000848152600360205260409020548490156105905760405163b1a7a2af60e01b8152600481018290526024016104cc565b6001546040516310e67a9d60e31b81526001600160a01b03808a16600483015289928992911690638733d4e890602401602060405180830381865afa1580156105dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106019190610dc7565b6001600160a01b0316816001600160a01b0316146106455760405163cc41100960e01b81526001600160a01b038084166004830152821660248201526044016104cc565b600254604051637553b06160e11b81526004810188905287916001600160a01b03169063eaa760c2906024016020604051808303816000875af1158015610690573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b49190610dae565b6000036106d75760405163063de83560e21b8152600481018290526024016104cc565b600088815260036020526040908190204390555188907fb244582b6218e1202021c674f5f9ba330f9393f8359101bb96445efeedff3db39061071e908c908a908a90610de4565b60405180910390a250505050505050505050565b61073a610863565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040805160008082526020820180845287905260ff8616928201929092526060810184905260808101839052819060019060a0016020604051602081039080840390855afa1580156107b2573d6000803e3d6000fd5b505050602060405103519050806001600160a01b0316876001600160a01b0316146108035760405163cc41100960e01b81526001600160a01b038089166004830152821660248201526044016104cc565b9695505050505050565b610816826108ac565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561085b576105108282610911565b610198610987565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff166103ed57604051631afcd79f60e31b815260040160405180910390fd5b806001600160a01b03163b6000036108e257604051634c9c8ce360e01b81526001600160a01b03821660048201526024016104cc565b600080516020610e4183398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161092e9190610e24565b600060405180830381855af49150503d8060008114610969576040519150601f19603f3d011682016040523d82523d6000602084013e61096e565b606091505b509150915061097e8583836109a6565b95945050505050565b34156103ed5760405163b398979f60e01b815260040160405180910390fd5b6060826109bb576109b682610a05565b6109fe565b81511580156109d257506001600160a01b0384163b155b156109fb57604051639996b31560e01b81526001600160a01b03851660048201526024016104cc565b50805b9392505050565b805115610a155780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b50565b6001600160a01b0381168114610a2e57600080fd5b634e487b7160e01b600052604160045260246000fd5b60008060408385031215610a6f57600080fd5b8235610a7a81610a31565b9150602083013567ffffffffffffffff80821115610a9757600080fd5b818501915085601f830112610aab57600080fd5b813581811115610abd57610abd610a46565b604051601f8201601f19908116603f01168101908382118183101715610ae557610ae5610a46565b81604052828152886020848701011115610afe57600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015610b3b578181015183820152602001610b23565b50506000910152565b6020815260008251806020840152610b63816040850160208701610b20565b601f01601f19169190910160400192915050565b60008083601f840112610b8957600080fd5b50813567ffffffffffffffff811115610ba157600080fd5b602083019150836020828501011115610bb957600080fd5b9250929050565b600080600080600060808688031215610bd857600080fd5b8535610be381610a31565b94506020860135935060408601359250606086013567ffffffffffffffff811115610c0d57600080fd5b610c1988828901610b77565b969995985093965092949392505050565b600080600060608486031215610c3f57600080fd5b8335610c4a81610a31565b92506020840135610c5a81610a31565b91506040840135610c6a81610a31565b809150509250925092565b600060208284031215610c8757600080fd5b5035919050565b60008060008060008060008060e0898b031215610caa57600080fd5b8835610cb581610a31565b9750602089013560ff81168114610ccb57600080fd5b965060408901359550606089013594506080890135935060a0890135925060c089013567ffffffffffffffff811115610d0357600080fd5b610d0f8b828c01610b77565b999c989b5096995094979396929594505050565b6001600160f81b03198981168252881660018201526bffffffffffffffffffffffff19606088811b8216600284015287901b1660168201527f63726561746543726564656e7469616c446566696e6974696f6e000000000000602a82015260448101859052606481018490526000828460848401375060009101608401908152979650505050505050565b600060208284031215610dc057600080fd5b5051919050565b600060208284031215610dd957600080fd5b81516109fe81610a31565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b60008251610e36818460208701610b20565b919091019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212200e0babf8db311bee606a13b3bbbda0b81acf97f50dbe34a186627f036317833f64736f6c63430008170033" } } } diff --git a/network/config/nodes/validator5/key b/network/config/nodes/validator5/key index 2607ffb5..78967120 100644 --- a/network/config/nodes/validator5/key +++ b/network/config/nodes/validator5/key @@ -1 +1 @@ -0x52bd45e5975ae4945094e5bc0444bb40527674204a03b09807d436db91590dcd \ No newline at end of file +0x5db90911d0929e4b638b46f53c05b14c38c066ad57c63091f4fdbbaedc117d85 \ No newline at end of file diff --git a/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol b/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol index 854d9da3..5c03cb2f 100644 --- a/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol +++ b/smart_contracts/contracts/cl/CredentialDefinitionRegistry.sol @@ -16,7 +16,7 @@ contract CredentialDefinitionRegistry is CredentialDefinitionRegistryInterface, SchemaRegistryInterface private _schemaRegistry; /** - * Mapping to track created created credential definitions by their id to block number. + * Mapping to track created credential definitions by their id to block number. */ mapping(bytes32 id => uint block) public created; diff --git a/vdr/Cargo.lock b/vdr/Cargo.lock index a5ca3273..54a6490a 100644 --- a/vdr/Cargo.lock +++ b/vdr/Cargo.lock @@ -1232,7 +1232,7 @@ dependencies = [ ] [[package]] -name = "indy2_vdr" +name = "indy-besu-vdr" version = "0.0.1" dependencies = [ "async-std", diff --git a/vdr/Cargo.toml b/vdr/Cargo.toml index 4081439e..5414aca7 100644 --- a/vdr/Cargo.toml +++ b/vdr/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "indy2_vdr" +name = "indy-besu-vdr" description = "A client library for interacting with Indy Ledger 2.0." version = "0.0.1" authors = ["Artem Ivanov "] @@ -8,7 +8,7 @@ license = "Apache-2.0" readme = "./README.md" [lib] -name = "indy2_vdr" +name = "indy_besu_vdr" path = "src/lib.rs" crate-type = ["rlib", "cdylib"] diff --git a/vdr/README.md b/vdr/README.md index 0fc26ea8..f00409ee 100644 --- a/vdr/README.md +++ b/vdr/README.md @@ -35,7 +35,7 @@ To use vdr, add this to your `Cargo.toml`: ``` [dependencies] -indy2_vdr = { path = "../path/to/crate" } +indy_besu_vdr = { path = "../path/to/crate" } ``` ## Code formatting diff --git a/vdr/src/client/client.rs b/vdr/src/client/client.rs index d3201661..99cd1a41 100644 --- a/vdr/src/client/client.rs +++ b/vdr/src/client/client.rs @@ -260,11 +260,6 @@ pub mod test { fn contracts() -> Vec { vec![ - // ContractConfig { - // address: DID_REGISTRY_ADDRESS.to_string(), - // spec_path: Some(build_contract_path(DID_REGISTRY_SPEC_PATH)), - // spec: None, - // }, ContractConfig { address: SCHEMA_REGISTRY_ADDRESS.to_string(), spec_path: Some(build_contract_path(SCHEMA_REGISTRY_SPEC_PATH)), diff --git a/vdr/src/contracts/cl/credential_definition_registry.rs b/vdr/src/contracts/cl/credential_definition_registry.rs index f7779b7d..a2bd0961 100644 --- a/vdr/src/contracts/cl/credential_definition_registry.rs +++ b/vdr/src/contracts/cl/credential_definition_registry.rs @@ -296,33 +296,7 @@ pub mod test { to: CRED_DEF_REGISTRY_ADDRESS.clone(), nonce: Some(DEFAULT_NONCE.clone()), chain_id: CHAIN_ID, - data: vec![ - 187, 199, 66, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 226, 219, 108, 141, - 198, 198, 129, 187, 93, 106, 209, 33, 161, 7, 243, 0, 233, 178, 181, 73, 77, - 222, 144, 79, 39, 191, 53, 141, 180, 7, 174, 32, 255, 241, 133, 79, 137, 100, - 14, 222, 118, 247, 141, 252, 216, 221, 232, 25, 32, 232, 199, 79, 65, 37, 166, - 217, 193, 224, 92, 150, 117, 26, 77, 108, 102, 77, 6, 238, 63, 247, 212, 122, - 19, 86, 115, 119, 131, 17, 47, 17, 46, 238, 182, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 23, 123, 34, 105, 115, 115, 117, 101, 114, 73, 100, 34, 58, 34, 100, 105, - 100, 58, 101, 116, 104, 114, 58, 116, 101, 115, 116, 110, 101, 116, 58, 48, - 120, 102, 48, 101, 50, 100, 98, 54, 99, 56, 100, 99, 54, 99, 54, 56, 49, 98, - 98, 53, 100, 54, 97, 100, 49, 50, 49, 97, 49, 48, 55, 102, 51, 48, 48, 101, 57, - 98, 50, 98, 53, 34, 44, 34, 115, 99, 104, 101, 109, 97, 73, 100, 34, 58, 34, - 100, 105, 100, 58, 105, 110, 100, 121, 50, 58, 116, 101, 115, 116, 110, 101, - 116, 58, 51, 76, 112, 106, 115, 122, 107, 103, 84, 109, 69, 51, 113, 84, 104, - 103, 101, 50, 53, 70, 90, 119, 47, 97, 110, 111, 110, 99, 114, 101, 100, 115, - 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, 70, 49, 68, 67, 108, 97, 70, 69, - 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, 34, 44, 34, 99, 114, 101, 100, 68, - 101, 102, 84, 121, 112, 101, 34, 58, 34, 67, 76, 34, 44, 34, 116, 97, 103, 34, - 58, 34, 100, 101, 102, 97, 117, 108, 116, 34, 44, 34, 118, 97, 108, 117, 101, - 34, 58, 123, 34, 110, 34, 58, 34, 55, 55, 57, 46, 46, 46, 51, 57, 55, 34, 44, - 34, 114, 99, 116, 120, 116, 34, 58, 34, 55, 55, 52, 46, 46, 46, 57, 55, 55, 34, - 44, 34, 115, 34, 58, 34, 55, 53, 48, 46, 46, 56, 57, 51, 34, 44, 34, 122, 34, - 58, 34, 54, 51, 50, 46, 46, 46, 48, 48, 53, 34, 125, 125, 0, 0, 0, 0, 0, 0, 0, - 0, 0, - ], + data: vec![187, 199, 66, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 226, 219, 108, 141, 198, 198, 129, 187, 93, 106, 209, 33, 161, 7, 243, 0, 233, 178, 181, 109, 71, 26, 149, 232, 163, 135, 235, 109, 104, 137, 85, 62, 141, 209, 156, 9, 33, 105, 94, 200, 254, 71, 119, 190, 195, 248, 17, 17, 141, 239, 177, 34, 27, 23, 130, 143, 227, 3, 94, 147, 14, 185, 63, 10, 50, 145, 115, 71, 104, 106, 145, 232, 190, 123, 84, 240, 64, 217, 94, 167, 52, 119, 152, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 42, 123, 34, 105, 115, 115, 117, 101, 114, 73, 100, 34, 58, 34, 100, 105, 100, 58, 101, 116, 104, 114, 58, 116, 101, 115, 116, 110, 101, 116, 58, 48, 120, 102, 48, 101, 50, 100, 98, 54, 99, 56, 100, 99, 54, 99, 54, 56, 49, 98, 98, 53, 100, 54, 97, 100, 49, 50, 49, 97, 49, 48, 55, 102, 51, 48, 48, 101, 57, 98, 50, 98, 53, 34, 44, 34, 115, 99, 104, 101, 109, 97, 73, 100, 34, 58, 34, 100, 105, 100, 58, 101, 116, 104, 114, 58, 116, 101, 115, 116, 110, 101, 116, 58, 48, 120, 102, 48, 101, 50, 100, 98, 54, 99, 56, 100, 99, 54, 99, 54, 56, 49, 98, 98, 53, 100, 54, 97, 100, 49, 50, 49, 97, 49, 48, 55, 102, 51, 48, 48, 101, 57, 98, 50, 98, 53, 47, 97, 110, 111, 110, 99, 114, 101, 100, 115, 47, 118, 48, 47, 83, 67, 72, 69, 77, 65, 47, 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, 51, 116, 47, 49, 46, 48, 46, 48, 34, 44, 34, 99, 114, 101, 100, 68, 101, 102, 84, 121, 112, 101, 34, 58, 34, 67, 76, 34, 44, 34, 116, 97, 103, 34, 58, 34, 100, 101, 102, 97, 117, 108, 116, 34, 44, 34, 118, 97, 108, 117, 101, 34, 58, 123, 34, 110, 34, 58, 34, 55, 55, 57, 46, 46, 46, 51, 57, 55, 34, 44, 34, 114, 99, 116, 120, 116, 34, 58, 34, 55, 55, 52, 46, 46, 46, 57, 55, 55, 34, 44, 34, 115, 34, 58, 34, 55, 53, 48, 46, 46, 56, 57, 51, 34, 44, 34, 122, 34, 58, 34, 54, 51, 50, 46, 46, 46, 48, 48, 53, 34, 125, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], signature: RwLock::new(None), hash: None, }; @@ -351,7 +325,7 @@ pub mod test { to_block: None, event_signature: None, event_filter: Some( - "494dde904f27bf358db407ae20fff1854f89640ede76f78dfcd8dde81920e8c7".to_string(), + "6d471a95e8a387eb6d6889553e8dd19c0921695ec8fe4777bec3f811118defb1".to_string(), ), }; assert_eq!(expected_query, query); diff --git a/vdr/src/contracts/cl/types/credential_definition.rs b/vdr/src/contracts/cl/types/credential_definition.rs index e401b17f..a2457871 100644 --- a/vdr/src/contracts/cl/types/credential_definition.rs +++ b/vdr/src/contracts/cl/types/credential_definition.rs @@ -85,7 +85,7 @@ pub mod test { }; use serde_json::json; - pub const _CREDENTIAL_DEFINITION_ID: &str = "did:indy2:testnet:3LpjszkgTmE3qThge25FZw/anoncreds/v0/CLAIM_DEF/did:indy2:testnet:3LpjszkgTmE3qThge25FZw/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0/default"; + pub const _CREDENTIAL_DEFINITION_ID: &str = "did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5/anoncreds/v0/CLAIM_DEF/did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0/default"; pub const CREDENTIAL_DEFINITION_TAG: &str = "default"; pub fn credential_definition_id( diff --git a/vdr/src/contracts/cl/types/schema.rs b/vdr/src/contracts/cl/types/schema.rs index e0f08810..f67f05c6 100644 --- a/vdr/src/contracts/cl/types/schema.rs +++ b/vdr/src/contracts/cl/types/schema.rs @@ -78,7 +78,7 @@ pub mod test { }; pub const SCHEMA_ID: &str = - "did:indy2:testnet:3LpjszkgTmE3qThge25FZw/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0"; + "did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0"; pub const SCHEMA_NAME: &str = "F1DClaFEzi3t"; pub const SCHEMA_VERSION: &str = "1.0.0"; pub const SCHEMA_ATTRIBUTE_FIRST_NAME: &str = "First Name"; diff --git a/vdr/src/contracts/did/did_ethr_registry.rs b/vdr/src/contracts/did/did_ethr_registry.rs index fd141a4f..4404b21b 100644 --- a/vdr/src/contracts/did/did_ethr_registry.rs +++ b/vdr/src/contracts/did/did_ethr_registry.rs @@ -893,9 +893,7 @@ pub async fn resolve_did( // TODO: support the case when DID identifier is public key // Query block number when DID was changed last time - let transaction = build_get_did_changed_transaction(client, &did).await?; - let response = client.submit_transaction(&transaction).await?; - let did_changed_block = parse_did_changed_result(client, &response)?; + let did_changed_block = get_did_changed_block(client, &did).await?; // if DID has not been ever changed, we do not need to query events and just return base did document if did_changed_block.is_none() { @@ -911,38 +909,11 @@ pub async fn resolve_did( let now = Utc::now().timestamp() as u64; // request events for a specific block until previous exists - let mut history: Vec = Vec::new(); - let mut previous_block: Option = Some(did_changed_block); - while previous_block.is_some() { - let transaction = build_get_did_events_query( - client, - &did, - previous_block.as_ref(), - previous_block.as_ref(), - ) - .await?; - let logs = client.query_events(&transaction).await?; - - // if no logs, break the loop as nothing to add to the change history - if logs.is_empty() { - break; - } - - // parse events - let events = logs - .iter() - .rev() - .map(|log| parse_did_event_response(client, log)) - .collect::>>()?; - - history.extend_from_slice(&events); - - previous_block = events.last().map(|event| event.previous_change()) - } + let did_history: Vec = receive_did_history(client, &did, did_changed_block).await?; // assemble Did Document from the history events // iterate in the reverse order -> oldest to newest - for history_item in history.iter().rev() { + for history_item in did_history.iter().rev() { match history_item { DidEvents::OwnerChanged(_event) => { // TODO: Handle DID Owner changes event as described: @@ -1009,6 +980,44 @@ pub async fn resolve_did( Ok(did_with_meta) } +async fn get_did_changed_block(client: &LedgerClient, did: &DID) -> VdrResult { + let transaction = build_get_did_changed_transaction(client, &did).await?; + let response = client.submit_transaction(&transaction).await?; + parse_did_changed_result(client, &response) +} + +async fn receive_did_history(client: &LedgerClient, did: &DID, first_block: Block) -> VdrResult> { + let mut history: Vec = Vec::new(); + let mut previous_block: Option = Some(first_block); + while previous_block.is_some() { + let transaction = build_get_did_events_query( + client, + did, + previous_block.as_ref(), + previous_block.as_ref(), + ) + .await?; + let logs = client.query_events(&transaction).await?; + + // if no logs, break the loop as nothing to add to the change history + if logs.is_empty() { + break; + } + + // parse events + let events = logs + .iter() + .rev() + .map(|log| parse_did_event_response(client, log)) + .collect::>>()?; + + history.extend_from_slice(&events); + + previous_block = events.last().map(|event| event.previous_change()) + } + Ok(history) +} + #[cfg(test)] pub mod test { use super::*; @@ -1027,6 +1036,7 @@ pub mod test { utils::init_env_logger, }; use std::sync::RwLock; + use crate::contracts::did::types::did_doc::test::{SERVICE_ENDPOINT, SERVICE_TYPE}; fn did() -> DID { DID::from(format!("did:ethr:{}", IDENTITY_ACC.as_ref()).as_str()) @@ -1034,8 +1044,8 @@ pub mod test { pub fn service() -> DidDocAttribute { DidDocAttribute::Service(ServiceAttribute { - type_: "Service".to_string(), - service_endpoint: ServiceEndpoint::String("http://example.com".to_string()), + type_: SERVICE_TYPE.to_string(), + service_endpoint: ServiceEndpoint::String(SERVICE_ENDPOINT.to_string()), }) } diff --git a/vdr/src/contracts/did/types/did_doc.rs b/vdr/src/contracts/did/types/did_doc.rs index d98ee921..5c36b446 100644 --- a/vdr/src/contracts/did/types/did_doc.rs +++ b/vdr/src/contracts/did/types/did_doc.rs @@ -277,8 +277,8 @@ pub mod test { pub const ISSUER_ID: &str = "did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5"; pub const CONTEXT: &str = "https://www.w3.org/ns/did/v1"; pub const MULTIBASE_KEY: &str = "zAKJP3f7BD6W4iWEQ9jwndVTCBq8ua2Utt8EEjJ6Vxsf"; - pub const SERVICE_ENDPOINT: &str = "127.0.0.1:5555"; - pub const SERVICE_TYPE: &str = "DIDCommService"; + pub const SERVICE_ENDPOINT: &str = "http://example.com"; + pub const SERVICE_TYPE: &str = "Service"; pub const KEY_1: &str = "KEY-1"; pub fn verification_method(id: &str) -> VerificationMethod { @@ -298,7 +298,7 @@ pub mod test { VerificationMethodOrReference::String(format!("{}#{}", id, KEY_1)) } - pub fn service(id: &str) -> Service { + pub fn _service(id: &str) -> Service { Service { id: id.to_string(), type_: SERVICE_TYPE.to_string(), @@ -308,7 +308,7 @@ pub mod test { pub fn new_id() -> String { format!( - "did:indy2:testnet:{}", + "did:ethr:testnet:{}", &bs58::encode(rand_bytes()).into_string() ) } diff --git a/vdr/uniffi.toml b/vdr/uniffi.toml index b1c0d19f..2048895e 100644 --- a/vdr/uniffi.toml +++ b/vdr/uniffi.toml @@ -1,2 +1,2 @@ [bindings.kotlin] -cdylib_name = "indy2_vdr_uniffi" \ No newline at end of file +cdylib_name = "indy_besu_vdr_uniffi" \ No newline at end of file diff --git a/vdr/uniffi/Cargo.toml b/vdr/uniffi/Cargo.toml index b932c089..26914252 100644 --- a/vdr/uniffi/Cargo.toml +++ b/vdr/uniffi/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "indy2-vdr-uniffi" +name = "indy-besu-vdr-uniffi" description = "Uni-FFI bindings for Indy 2.0 VDR" version = "0.1.0" authors = [ @@ -10,7 +10,7 @@ license = "Apache-2.0" readme = "./README.md" [lib] -name = "indy2_vdr_uniffi" +name = "indy_besu_vdr_uniffi" path = "src/lib.rs" crate-type = ["rlib", "cdylib"] @@ -22,7 +22,7 @@ path = "src/bin.rs" default = [] [dependencies] -indy2_vdr = { path = ".." } +indy-besu-vdr = { path = ".." } serde = "1.0.188" serde_derive = "1.0.188" serde_json = "1.0.107" diff --git a/vdr/uniffi/README.md b/vdr/uniffi/README.md index 5e291de6..cdba8ab5 100644 --- a/vdr/uniffi/README.md +++ b/vdr/uniffi/README.md @@ -13,7 +13,7 @@ language ``: ``` cargo build --release -cargo run --bin uniffi-bindgen generate --library target/release/libindy2_vdr_uniffi.dylib --language --out-dir out +cargo run --bin uniffi-bindgen generate --library target/release/libindy_besu_vdr_uniffi.dylib --language --out-dir out ``` The check `out` directory which will contain generated bindings. diff --git a/vdr/uniffi/build.rs b/vdr/uniffi/build.rs index c01f70f5..9c9a00e4 100644 --- a/vdr/uniffi/build.rs +++ b/vdr/uniffi/build.rs @@ -1,3 +1,3 @@ fn main() { - uniffi::generate_scaffolding("src/indy2_vdr.udl").unwrap(); + uniffi::generate_scaffolding("src/indy_besu_vdr.udl").unwrap(); } diff --git a/vdr/uniffi/src/ffi/client.rs b/vdr/uniffi/src/ffi/client.rs index cbc3207c..f17de2ed 100644 --- a/vdr/uniffi/src/ffi/client.rs +++ b/vdr/uniffi/src/ffi/client.rs @@ -7,7 +7,7 @@ use crate::{ }, VdrError, }; -use indy2_vdr::{ContractConfig as ContractConfig_, LedgerClient as LedgerClient_}; +use indy_besu_vdr::{ContractConfig as ContractConfig_, LedgerClient as LedgerClient_}; #[derive(uniffi::Object)] pub struct LedgerClient { diff --git a/vdr/uniffi/src/ffi/contracts/credential_definition_registry.rs b/vdr/uniffi/src/ffi/contracts/credential_definition_registry.rs index 53999de2..fd7e8de4 100644 --- a/vdr/uniffi/src/ffi/contracts/credential_definition_registry.rs +++ b/vdr/uniffi/src/ffi/contracts/credential_definition_registry.rs @@ -5,7 +5,7 @@ use crate::ffi::{ transaction::{Transaction, TransactionEndorsingData}, types::SignatureData, }; -use indy2_vdr::{ +use indy_besu_vdr::{ credential_definition_registry, Address, Block, CredentialDefinitionId, }; use serde_json::json; diff --git a/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs b/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs index b1cee60e..60f2192e 100644 --- a/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs +++ b/vdr/uniffi/src/ffi/contracts/did_ethr_registry.rs @@ -5,7 +5,7 @@ use crate::ffi::{ transaction::{Transaction, TransactionEndorsingData}, types::SignatureData, }; -use indy2_vdr::{ +use indy_besu_vdr::{ did_ethr_registry, Address, Block, DelegateType, DidAttributeChanged as DidAttributeChanged_, DidDelegateChanged as DidDelegateChanged_, DidDocAttribute, DidEvents as DidEvents_, DidOwnerChanged as DidOwnerChanged_, DidResolutionOptions as DidResolutionOptions_, Validity, diff --git a/vdr/uniffi/src/ffi/contracts/role_control.rs b/vdr/uniffi/src/ffi/contracts/role_control.rs index c91c9524..970548b9 100644 --- a/vdr/uniffi/src/ffi/contracts/role_control.rs +++ b/vdr/uniffi/src/ffi/contracts/role_control.rs @@ -3,7 +3,7 @@ use crate::ffi::{ error::{VdrError, VdrResult}, transaction::Transaction, }; -use indy2_vdr::{role_control, Address, Role}; +use indy_besu_vdr::{role_control, Address, Role}; #[uniffi::export(async_runtime = "tokio")] pub async fn build_assign_role_transaction( diff --git a/vdr/uniffi/src/ffi/contracts/schema_registry.rs b/vdr/uniffi/src/ffi/contracts/schema_registry.rs index 1a78c64f..16f7befd 100644 --- a/vdr/uniffi/src/ffi/contracts/schema_registry.rs +++ b/vdr/uniffi/src/ffi/contracts/schema_registry.rs @@ -5,7 +5,7 @@ use crate::ffi::{ transaction::{Transaction, TransactionEndorsingData}, types::SignatureData, }; -use indy2_vdr::{schema_registry, Address, Block, SchemaId}; +use indy_besu_vdr::{schema_registry, Address, Block, SchemaId}; use serde_json::json; #[uniffi::export(async_runtime = "tokio")] diff --git a/vdr/uniffi/src/ffi/contracts/validator_control.rs b/vdr/uniffi/src/ffi/contracts/validator_control.rs index c43ae73e..9fdab119 100644 --- a/vdr/uniffi/src/ffi/contracts/validator_control.rs +++ b/vdr/uniffi/src/ffi/contracts/validator_control.rs @@ -1,5 +1,5 @@ use crate::ffi::{client::LedgerClient, error::VdrResult, transaction::Transaction}; -use indy2_vdr::{validator_control, Address}; +use indy_besu_vdr::{validator_control, Address}; use serde_json::json; #[uniffi::export(async_runtime = "tokio")] diff --git a/vdr/uniffi/src/ffi/error.rs b/vdr/uniffi/src/ffi/error.rs index bea3eb47..dd210c10 100644 --- a/vdr/uniffi/src/ffi/error.rs +++ b/vdr/uniffi/src/ffi/error.rs @@ -1,4 +1,4 @@ -use indy2_vdr::VdrError as VdrError_; +use indy_besu_vdr::VdrError as VdrError_; #[derive(thiserror::Error, Debug, uniffi::Error)] pub enum VdrError { diff --git a/vdr/uniffi/src/ffi/event_query.rs b/vdr/uniffi/src/ffi/event_query.rs index 68866eee..d9ff393a 100644 --- a/vdr/uniffi/src/ffi/event_query.rs +++ b/vdr/uniffi/src/ffi/event_query.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{Address, Block, EventLog as EventLog_, EventQuery as EventQuery_}; +use indy_besu_vdr::{Address, Block, EventLog as EventLog_, EventQuery as EventQuery_}; #[derive(uniffi::Object)] pub struct EventQuery { diff --git a/vdr/uniffi/src/ffi/transaction.rs b/vdr/uniffi/src/ffi/transaction.rs index e6c1d5de..1595697e 100644 --- a/vdr/uniffi/src/ffi/transaction.rs +++ b/vdr/uniffi/src/ffi/transaction.rs @@ -2,7 +2,7 @@ use crate::ffi::{ error::{VdrError, VdrResult}, types::{SignatureData, TransactionSignature, TransactionType}, }; -use indy2_vdr::{ +use indy_besu_vdr::{ Address, Transaction as Transaction_, TransactionEndorsingData as TransactionEndorsingData_, }; diff --git a/vdr/uniffi/src/ffi/types.rs b/vdr/uniffi/src/ffi/types.rs index 6ac676ac..d174e655 100644 --- a/vdr/uniffi/src/ffi/types.rs +++ b/vdr/uniffi/src/ffi/types.rs @@ -1,5 +1,5 @@ use crate::JsonValue; -use indy2_vdr::{ +use indy_besu_vdr::{ ContractConfig as ContractConfig_, ContractSpec as ContractSpec_, PingStatus as PingStatus_, QuorumConfig as QuorumConfig_, SignatureData as SignatureData_, Status as Status_, TransactionSignature as TransactionSignature_, TransactionType as TransactionType_, diff --git a/vdr/uniffi/src/indy2_vdr.udl b/vdr/uniffi/src/indy_besu_vdr.udl similarity index 67% rename from vdr/uniffi/src/indy2_vdr.udl rename to vdr/uniffi/src/indy_besu_vdr.udl index 706bbea2..c09fef34 100644 --- a/vdr/uniffi/src/indy2_vdr.udl +++ b/vdr/uniffi/src/indy_besu_vdr.udl @@ -1,3 +1,3 @@ // This file is required for UNI-FFI binding generation -namespace indy2_vdr {}; +namespace indy_besu_vdr {}; diff --git a/vdr/uniffi/src/lib.rs b/vdr/uniffi/src/lib.rs index 375abbd9..b072beeb 100644 --- a/vdr/uniffi/src/lib.rs +++ b/vdr/uniffi/src/lib.rs @@ -18,4 +18,4 @@ impl UniffiCustomTypeConverter for JsonValue { } uniffi::custom_type!(JsonValue, String); -uniffi::include_scaffolding!("indy2_vdr"); +uniffi::include_scaffolding!("indy_besu_vdr"); diff --git a/vdr/wasm/Cargo.toml b/vdr/wasm/Cargo.toml index 8860b59b..c497e323 100644 --- a/vdr/wasm/Cargo.toml +++ b/vdr/wasm/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "indy2-vdr-wasm" +name = "indy-besu-vdr-wasm" description = "JavaScript bindings for Indy 2.0 VDR" version = "0.1.0" authors = [ @@ -11,14 +11,14 @@ readme = "./README.md" [lib] crate-type = ["cdylib", "rlib"] -name = "indy2_vdr_wasm" +name = "indy_besu_vdr_wasm" path = "src/lib.rs" [features] default = [] [dependencies] -indy2_vdr = { path = "..", default-features = false, features = ['wasm'] } +indy-besu-vdr = { path = "..", default-features = false, features = ['wasm'] } wasm-bindgen = "0.2.87" wasm-bindgen-futures = "0.4.37" js-sys = "0.3.64" diff --git a/vdr/wasm/demo/node/package.json b/vdr/wasm/demo/node/package.json index 33cf03a8..c2050fbe 100644 --- a/vdr/wasm/demo/node/package.json +++ b/vdr/wasm/demo/node/package.json @@ -1,7 +1,7 @@ { - "name": "indy2-vdr-wasm-demo", + "name": "indy-besu-vdr-wasm-demo", "version": "0.1.0", - "description": "NodeJS demo for indy2-vdr wasm bindings", + "description": "NodeJS demo for indy-besu-vdr wasm bindings", "scripts": { "start": "ts-node src/main.ts", "check": "tslint -c tslint.json 'src/**/*.ts'" @@ -11,7 +11,7 @@ "dependencies": { "@types/bs58": "^4.0.4", "bs58": "^5.0.0", - "indy2-vdr": "file:../../pkg", + "indy-besu-vdr": "file:../../pkg", "secp256k1": "5.0.0", "typescript": "^4.5.2" }, diff --git a/vdr/wasm/demo/node/src/main.ts b/vdr/wasm/demo/node/src/main.ts index a0af1d6f..993598dd 100644 --- a/vdr/wasm/demo/node/src/main.ts +++ b/vdr/wasm/demo/node/src/main.ts @@ -1,7 +1,7 @@ import fs from "fs"; import secp256k1 from "secp256k1"; -import { LedgerClient, EthrDidRegistry, SchemaRegistry } from "indy2-vdr"; +import { LedgerClient, EthrDidRegistry, SchemaRegistry } from "indy-besu-vdr"; const chainId = 1337 const nodeAddress = 'http://127.0.0.1:8545' diff --git a/vdr/wasm/src/client.rs b/vdr/wasm/src/client.rs index cfb8dd99..e4834c5c 100644 --- a/vdr/wasm/src/client.rs +++ b/vdr/wasm/src/client.rs @@ -3,7 +3,7 @@ use std::rc::Rc; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::future_to_promise; -use indy2_vdr::{ContractConfig, LedgerClient, QuorumConfig}; +use indy_besu_vdr::{ContractConfig, LedgerClient, QuorumConfig}; use crate::{ error::{JsResult, Result}, diff --git a/vdr/wasm/src/contracts/credential_definition_registry.rs b/vdr/wasm/src/contracts/credential_definition_registry.rs index addc30b3..d1bca190 100644 --- a/vdr/wasm/src/contracts/credential_definition_registry.rs +++ b/vdr/wasm/src/contracts/credential_definition_registry.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{ +use indy_besu_vdr::{ credential_definition_registry, Address, Block, CredentialDefinition, CredentialDefinitionId, EventLog, SignatureData, }; diff --git a/vdr/wasm/src/contracts/did_ethr_registry.rs b/vdr/wasm/src/contracts/did_ethr_registry.rs index fbe17d3e..5eef7241 100644 --- a/vdr/wasm/src/contracts/did_ethr_registry.rs +++ b/vdr/wasm/src/contracts/did_ethr_registry.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{ +use indy_besu_vdr::{ did_ethr_registry, Address, Block, DelegateType, DidDocAttribute, DidResolutionOptions, EventLog, SignatureData, Validity, DID, }; diff --git a/vdr/wasm/src/contracts/role_control.rs b/vdr/wasm/src/contracts/role_control.rs index 14365bef..905e98e0 100644 --- a/vdr/wasm/src/contracts/role_control.rs +++ b/vdr/wasm/src/contracts/role_control.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{role_control, Address, Role}; +use indy_besu_vdr::{role_control, Address, Role}; use std::rc::Rc; use wasm_bindgen::prelude::*; diff --git a/vdr/wasm/src/contracts/schema_registry.rs b/vdr/wasm/src/contracts/schema_registry.rs index c7eec7ff..e103ffaa 100644 --- a/vdr/wasm/src/contracts/schema_registry.rs +++ b/vdr/wasm/src/contracts/schema_registry.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{schema_registry, Address, Block, EventLog, Schema, SchemaId, SignatureData}; +use indy_besu_vdr::{schema_registry, Address, Block, EventLog, Schema, SchemaId, SignatureData}; use std::rc::Rc; use wasm_bindgen::prelude::*; diff --git a/vdr/wasm/src/contracts/validator_control.rs b/vdr/wasm/src/contracts/validator_control.rs index d5f806a0..34935328 100644 --- a/vdr/wasm/src/contracts/validator_control.rs +++ b/vdr/wasm/src/contracts/validator_control.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{validator_control, Address}; +use indy_besu_vdr::{validator_control, Address}; use std::rc::Rc; use wasm_bindgen::prelude::*; diff --git a/vdr/wasm/src/error.rs b/vdr/wasm/src/error.rs index 724414c1..de9c1a80 100644 --- a/vdr/wasm/src/error.rs +++ b/vdr/wasm/src/error.rs @@ -1,4 +1,4 @@ -use indy2_vdr::VdrResult; +use indy_besu_vdr::VdrResult; use js_sys::Error as JsError; use wasm_bindgen::JsValue; diff --git a/vdr/wasm/src/event_query.rs b/vdr/wasm/src/event_query.rs index f27debbb..88056202 100644 --- a/vdr/wasm/src/event_query.rs +++ b/vdr/wasm/src/event_query.rs @@ -1,4 +1,4 @@ -use indy2_vdr::EventQuery; +use indy_besu_vdr::EventQuery; use std::rc::Rc; use wasm_bindgen::prelude::*; diff --git a/vdr/wasm/src/transaction.rs b/vdr/wasm/src/transaction.rs index 853b04be..7ca00ed5 100644 --- a/vdr/wasm/src/transaction.rs +++ b/vdr/wasm/src/transaction.rs @@ -1,4 +1,4 @@ -use indy2_vdr::{SignatureData, Transaction, TransactionEndorsingData}; +use indy_besu_vdr::{SignatureData, Transaction, TransactionEndorsingData}; use std::rc::Rc; use wasm_bindgen::prelude::*; diff --git a/vdr/wrappers/python/README.md b/vdr/wrappers/python/README.md index 9f5a5af5..cdcc0dc3 100644 --- a/vdr/wrappers/python/README.md +++ b/vdr/wrappers/python/README.md @@ -10,8 +10,8 @@ This is thin python package created on top of Indy Besu bindings generated using 1. Bindings building: * Build bindings as describe in uniffi [README.md](../../uniffi/README.md). - * Copy `uniffi/out/indy2_vdr` file and put into `wrappers/python/indy2_vdr` folder. - * Copy `uniffi/target/release/libindy2_vdr_uniffi.dylib` file and put into `wrappers/python/indy2_vdr` folder. + * Copy `uniffi/out/indy_besu_vdr` file and put into `wrappers/python/indy_besu_vdr` folder. + * Copy `uniffi/target/release/libindy_besu_vdr_uniffi.dylib` file and put into `wrappers/python/indy_besu_vdr` folder. 2. Package building: * Run the following commands: ``` diff --git a/vdr/wrappers/python/demo/test.py b/vdr/wrappers/python/demo/test.py index a3643bc8..d41a0abd 100644 --- a/vdr/wrappers/python/demo/test.py +++ b/vdr/wrappers/python/demo/test.py @@ -4,7 +4,7 @@ import string from eth_keys import keys -from indy2_vdr import * +from indy_besu_vdr import * # chain id of the running network chain_id = 1337 diff --git a/vdr/wrappers/python/indy2_vdr/__init__.py b/vdr/wrappers/python/indy_besu_vdr/__init__.py similarity index 99% rename from vdr/wrappers/python/indy2_vdr/__init__.py rename to vdr/wrappers/python/indy_besu_vdr/__init__.py index e7197587..5c18d229 100644 --- a/vdr/wrappers/python/indy2_vdr/__init__.py +++ b/vdr/wrappers/python/indy_besu_vdr/__init__.py @@ -1,5 +1,5 @@ """Indy2 VDR Python wrapper""" -from .indy2_vdr import ( +from .indy_besu_vdr import ( InternalError, Status, TransactionType, diff --git a/vdr/wrappers/python/indy2_vdr/indy2_vdr.py b/vdr/wrappers/python/indy_besu_vdr/indy2_vdr.py similarity index 100% rename from vdr/wrappers/python/indy2_vdr/indy2_vdr.py rename to vdr/wrappers/python/indy_besu_vdr/indy2_vdr.py diff --git a/vdr/wrappers/python/indy_besu_vdr/indy_besu_vdr.py b/vdr/wrappers/python/indy_besu_vdr/indy_besu_vdr.py new file mode 100644 index 00000000..b2c377f0 --- /dev/null +++ b/vdr/wrappers/python/indy_besu_vdr/indy_besu_vdr.py @@ -0,0 +1,4568 @@ + + +# This file was autogenerated by some hot garbage in the `uniffi` crate. +# Trust me, you don't want to mess with it! + +# Common helper code. +# +# Ideally this would live in a separate .py file where it can be unittested etc +# in isolation, and perhaps even published as a re-useable package. +# +# However, it's important that the details of how this helper code works (e.g. the +# way that different builtin types are passed across the FFI) exactly match what's +# expected by the rust code on the other side of the interface. In practice right +# now that means coming from the exact some version of `uniffi` that was used to +# compile the rust component. The easiest way to ensure this is to bundle the Python +# helpers directly inline like we're doing here. + +import os +import sys +import ctypes +import enum +import struct +import contextlib +import datetime +import typing +import asyncio +import platform + +# Used for default argument values +_DEFAULT = object() + + +class _UniffiRustBuffer(ctypes.Structure): + _fields_ = [ + ("capacity", ctypes.c_int32), + ("len", ctypes.c_int32), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + @staticmethod + def alloc(size): + return _rust_call(_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_alloc, size) + + @staticmethod + def reserve(rbuf, additional): + return _rust_call(_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_reserve, rbuf, additional) + + def free(self): + return _rust_call(_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_free, self) + + def __str__(self): + return "_UniffiRustBuffer(capacity={}, len={}, data={})".format( + self.capacity, + self.len, + self.data[0:self.len] + ) + + @contextlib.contextmanager + def alloc_with_builder(*args): + """Context-manger to allocate a buffer using a _UniffiRustBufferBuilder. + + The allocated buffer will be automatically freed if an error occurs, ensuring that + we don't accidentally leak it. + """ + builder = _UniffiRustBufferBuilder() + try: + yield builder + except: + builder.discard() + raise + + @contextlib.contextmanager + def consume_with_stream(self): + """Context-manager to consume a buffer using a _UniffiRustBufferStream. + + The _UniffiRustBuffer will be freed once the context-manager exits, ensuring that we don't + leak it even if an error occurs. + """ + try: + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError("junk data left in buffer at end of consume_with_stream") + finally: + self.free() + + @contextlib.contextmanager + def read_with_stream(self): + """Context-manager to read a buffer using a _UniffiRustBufferStream. + + This is like consume_with_stream, but doesn't free the buffer afterwards. + It should only be used with borrowed `_UniffiRustBuffer` data. + """ + s = _UniffiRustBufferStream.from_rust_buffer(self) + yield s + if s.remaining() != 0: + raise RuntimeError("junk data left in buffer at end of read_with_stream") + +class _UniffiForeignBytes(ctypes.Structure): + _fields_ = [ + ("len", ctypes.c_int32), + ("data", ctypes.POINTER(ctypes.c_char)), + ] + + def __str__(self): + return "_UniffiForeignBytes(len={}, data={})".format(self.len, self.data[0:self.len]) + + +class _UniffiRustBufferStream: + """ + Helper for structured reading of bytes from a _UniffiRustBuffer + """ + + def __init__(self, data, len): + self.data = data + self.len = len + self.offset = 0 + + @classmethod + def from_rust_buffer(cls, buf): + return cls(buf.data, buf.len) + + def remaining(self): + return self.len - self.offset + + def _unpack_from(self, size, format): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + value = struct.unpack(format, self.data[self.offset:self.offset+size])[0] + self.offset += size + return value + + def read(self, size): + if self.offset + size > self.len: + raise InternalError("read past end of rust buffer") + data = self.data[self.offset:self.offset+size] + self.offset += size + return data + + def read_i8(self): + return self._unpack_from(1, ">b") + + def read_u8(self): + return self._unpack_from(1, ">B") + + def read_i16(self): + return self._unpack_from(2, ">h") + + def read_u16(self): + return self._unpack_from(2, ">H") + + def read_i32(self): + return self._unpack_from(4, ">i") + + def read_u32(self): + return self._unpack_from(4, ">I") + + def read_i64(self): + return self._unpack_from(8, ">q") + + def read_u64(self): + return self._unpack_from(8, ">Q") + + def read_float(self): + v = self._unpack_from(4, ">f") + return v + + def read_double(self): + return self._unpack_from(8, ">d") + + def read_c_size_t(self): + return self._unpack_from(ctypes.sizeof(ctypes.c_size_t) , "@N") + +class _UniffiRustBufferBuilder: + """ + Helper for structured writing of bytes into a _UniffiRustBuffer. + """ + + def __init__(self): + self.rbuf = _UniffiRustBuffer.alloc(16) + self.rbuf.len = 0 + + def finalize(self): + rbuf = self.rbuf + self.rbuf = None + return rbuf + + def discard(self): + if self.rbuf is not None: + rbuf = self.finalize() + rbuf.free() + + @contextlib.contextmanager + def _reserve(self, num_bytes): + if self.rbuf.len + num_bytes > self.rbuf.capacity: + self.rbuf = _UniffiRustBuffer.reserve(self.rbuf, num_bytes) + yield None + self.rbuf.len += num_bytes + + def _pack_into(self, size, format, value): + with self._reserve(size): + # XXX TODO: I feel like I should be able to use `struct.pack_into` here but can't figure it out. + for i, byte in enumerate(struct.pack(format, value)): + self.rbuf.data[self.rbuf.len + i] = byte + + def write(self, value): + with self._reserve(len(value)): + for i, byte in enumerate(value): + self.rbuf.data[self.rbuf.len + i] = byte + + def write_i8(self, v): + self._pack_into(1, ">b", v) + + def write_u8(self, v): + self._pack_into(1, ">B", v) + + def write_i16(self, v): + self._pack_into(2, ">h", v) + + def write_u16(self, v): + self._pack_into(2, ">H", v) + + def write_i32(self, v): + self._pack_into(4, ">i", v) + + def write_u32(self, v): + self._pack_into(4, ">I", v) + + def write_i64(self, v): + self._pack_into(8, ">q", v) + + def write_u64(self, v): + self._pack_into(8, ">Q", v) + + def write_float(self, v): + self._pack_into(4, ">f", v) + + def write_double(self, v): + self._pack_into(8, ">d", v) + + def write_c_size_t(self, v): + self._pack_into(ctypes.sizeof(ctypes.c_size_t) , "@N", v) +# A handful of classes and functions to support the generated data structures. +# This would be a good candidate for isolating in its own ffi-support lib. + +class InternalError(Exception): + pass + +class _UniffiRustCallStatus(ctypes.Structure): + """ + Error runtime. + """ + _fields_ = [ + ("code", ctypes.c_int8), + ("error_buf", _UniffiRustBuffer), + ] + + # These match the values from the uniffi::rustcalls module + CALL_SUCCESS = 0 + CALL_ERROR = 1 + CALL_UNEXPECTED_ERROR = 2 + + def __str__(self): + if self.code == _UniffiRustCallStatus.CALL_SUCCESS: + return "_UniffiRustCallStatus(CALL_SUCCESS)" + elif self.code == _UniffiRustCallStatus.CALL_ERROR: + return "_UniffiRustCallStatus(CALL_ERROR)" + elif self.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + return "_UniffiRustCallStatus(CALL_UNEXPECTED_ERROR)" + else: + return "_UniffiRustCallStatus()" + +def _rust_call(fn, *args): + # Call a rust function + return _rust_call_with_error(None, fn, *args) + +def _rust_call_with_error(error_ffi_converter, fn, *args): + # Call a rust function and handle any errors + # + # This function is used for rust calls that return Result<> and therefore can set the CALL_ERROR status code. + # error_ffi_converter must be set to the _UniffiConverter for the error class that corresponds to the result. + call_status = _UniffiRustCallStatus(code=_UniffiRustCallStatus.CALL_SUCCESS, error_buf=_UniffiRustBuffer(0, 0, None)) + + args_with_error = args + (ctypes.byref(call_status),) + result = fn(*args_with_error) + _uniffi_check_call_status(error_ffi_converter, call_status) + return result + +def _uniffi_check_call_status(error_ffi_converter, call_status): + if call_status.code == _UniffiRustCallStatus.CALL_SUCCESS: + pass + elif call_status.code == _UniffiRustCallStatus.CALL_ERROR: + if error_ffi_converter is None: + call_status.error_buf.free() + raise InternalError("_rust_call_with_error: CALL_ERROR, but error_ffi_converter is None") + else: + raise error_ffi_converter.lift(call_status.error_buf) + elif call_status.code == _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR: + # When the rust code sees a panic, it tries to construct a _UniffiRustBuffer + # with the message. But if that code panics, then it just sends back + # an empty buffer. + if call_status.error_buf.len > 0: + msg = _UniffiConverterString.lift(call_status.error_buf) + else: + msg = "Unknown rust panic" + raise InternalError(msg) + else: + raise InternalError("Invalid _UniffiRustCallStatus code: {}".format( + call_status.code)) + +def _uniffi_trait_interface_call(call_status, make_call, write_return_value): + try: + return write_return_value(make_call()) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiConverterString.lower(repr(e)) + +def _uniffi_trait_interface_call_with_error(call_status, make_call, write_return_value, error_type, lower_error): + try: + try: + return write_return_value(make_call()) + except error_type as e: + call_status.code = _UniffiRustCallStatus.CALL_ERROR + call_status.error_buf = lower_error(e) + except Exception as e: + call_status.code = _UniffiRustCallStatus.CALL_UNEXPECTED_ERROR + call_status.error_buf = _UniffiConverterString.lower(repr(e)) +class _UniffiPointerManagerCPython: + """ + Manage giving out pointers to Python objects on CPython + + This class is used to generate opaque pointers that reference Python objects to pass to Rust. + It assumes a CPython platform. See _UniffiPointerManagerGeneral for the alternative. + """ + + def new_pointer(self, obj): + """ + Get a pointer for an object as a ctypes.c_size_t instance + + Each call to new_pointer() must be balanced with exactly one call to release_pointer() + + This returns a ctypes.c_size_t. This is always the same size as a pointer and can be + interchanged with pointers for FFI function arguments and return values. + """ + # IncRef the object since we're going to pass a pointer to Rust + ctypes.pythonapi.Py_IncRef(ctypes.py_object(obj)) + # id() is the object address on CPython + # (https://docs.python.org/3/library/functions.html#id) + return id(obj) + + def release_pointer(self, address): + py_obj = ctypes.cast(address, ctypes.py_object) + obj = py_obj.value + ctypes.pythonapi.Py_DecRef(py_obj) + return obj + + def lookup(self, address): + return ctypes.cast(address, ctypes.py_object).value + +class _UniffiPointerManagerGeneral: + """ + Manage giving out pointers to Python objects on non-CPython platforms + + This has the same API as _UniffiPointerManagerCPython, but doesn't assume we're running on + CPython and is slightly slower. + + Instead of using real pointers, it maps integer values to objects and returns the keys as + c_size_t values. + """ + + def __init__(self): + self._map = {} + self._lock = threading.Lock() + self._current_handle = 0 + + def new_pointer(self, obj): + with self._lock: + handle = self._current_handle + self._current_handle += 1 + self._map[handle] = obj + return handle + + def release_pointer(self, handle): + with self._lock: + return self._map.pop(handle) + + def lookup(self, handle): + with self._lock: + return self._map[handle] + +# Pick an pointer manager implementation based on the platform +if platform.python_implementation() == 'CPython': + _UniffiPointerManager = _UniffiPointerManagerCPython # type: ignore +else: + _UniffiPointerManager = _UniffiPointerManagerGeneral # type: ignore +# Types conforming to `_UniffiConverterPrimitive` pass themselves directly over the FFI. +class _UniffiConverterPrimitive: + @classmethod + def lift(cls, value): + return value + + @classmethod + def lower(cls, value): + return value + +class _UniffiConverterPrimitiveInt(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__index__() + except Exception: + raise TypeError("'{}' object cannot be interpreted as an integer".format(type(value).__name__)) + if not isinstance(value, int): + raise TypeError("__index__ returned non-int (type {})".format(type(value).__name__)) + if not cls.VALUE_MIN <= value < cls.VALUE_MAX: + raise ValueError("{} requires {} <= value < {}".format(cls.CLASS_NAME, cls.VALUE_MIN, cls.VALUE_MAX)) + +class _UniffiConverterPrimitiveFloat(_UniffiConverterPrimitive): + @classmethod + def check_lower(cls, value): + try: + value = value.__float__() + except Exception: + raise TypeError("must be real number, not {}".format(type(value).__name__)) + if not isinstance(value, float): + raise TypeError("__float__ returned non-float (type {})".format(type(value).__name__)) + +# Helper class for wrapper types that will always go through a _UniffiRustBuffer. +# Classes should inherit from this and implement the `read` and `write` static methods. +class _UniffiConverterRustBuffer: + @classmethod + def lift(cls, rbuf): + with rbuf.consume_with_stream() as stream: + return cls.read(stream) + + @classmethod + def lower(cls, value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + cls.write(value, builder) + return builder.finalize() + +# Contains loading, initialization code, and the FFI Function declarations. +# Define some ctypes FFI types that we use in the library + +""" +Function pointer for a Rust task, which a callback function that takes a opaque pointer +""" +_UNIFFI_RUST_TASK = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.c_int8) + +def _uniffi_future_callback_t(return_type): + """ + Factory function to create callback function types for async functions + """ + return ctypes.CFUNCTYPE(None, ctypes.c_size_t, return_type, _UniffiRustCallStatus) + +def _uniffi_load_indirect(): + """ + This is how we find and load the dynamic library provided by the component. + For now we just look it up by name. + """ + if sys.platform == "darwin": + libname = "lib{}.dylib" + elif sys.platform.startswith("win"): + # As of python3.8, ctypes does not seem to search $PATH when loading DLLs. + # We could use `os.add_dll_directory` to configure the search path, but + # it doesn't feel right to mess with application-wide settings. Let's + # assume that the `.dll` is next to the `.py` file and load by full path. + libname = os.path.join( + os.path.dirname(__file__), + "{}.dll", + ) + else: + # Anything else must be an ELF platform - Linux, *BSD, Solaris/illumos + libname = "lib{}.so" + + libname = libname.format("indy_besu_vdr_uniffi") + path = os.path.join(os.path.dirname(__file__), libname) + lib = ctypes.cdll.LoadLibrary(path) + return lib + +def _uniffi_check_contract_api_version(lib): + # Get the bindings contract version from our ComponentInterface + bindings_contract_version = 25 + # Get the scaffolding contract version by calling the into the dylib + scaffolding_contract_version = lib.ffi_indy_besu_vdr_uniffi_uniffi_contract_version() + if bindings_contract_version != scaffolding_contract_version: + raise InternalError("UniFFI contract version mismatch: try cleaning and rebuilding your project") + +def _uniffi_check_api_checksums(lib): + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_add_validator_transaction() != 2909: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_assign_role_transaction() != 13494: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_endorsing_data() != 59949: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_signed_transaction() != 6216: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_transaction() != 59923: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_endorsing_data() != 3325: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_signed_transaction() != 56271: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_transaction() != 6657: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_endorsing_data() != 21660: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_signed_transaction() != 6684: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_transaction() != 5942: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_endorsing_data() != 21431: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_signed_transaction() != 25381: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_transaction() != 41898: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_endorsing_data() != 24316: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_signed_transaction() != 59037: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_transaction() != 59289: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_endorsing_data() != 14031: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_signed_transaction() != 7578: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_transaction() != 55423: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_endorsing_data() != 8983: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_signed_transaction() != 64551: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_transaction() != 65451: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_created_transaction() != 55886: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_query() != 15375: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_changed_transaction() != 41555: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_events_query() != 35752: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_owner_transaction() != 29722: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_identity_nonce_transaction() != 21686: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_role_transaction() != 34920: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_created_transaction() != 11928: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_query() != 36622: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_validators_transaction() != 16117: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_has_role_transaction() != 35189: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_remove_validator_transaction() != 23482: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_revoke_role_transaction() != 41767: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_event() != 43712: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_result() != 43952: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_attribute_changed_event_response() != 27285: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_changed_result() != 11223: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_delegate_changed_event_response() != 48798: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_event_response() != 5583: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_changed_event_response() != 45369: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_result() != 11739: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_role_result() != 24565: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_validators_result() != 34604: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_has_role_result() != 16372: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_event() != 39931: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_result() != 64564: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_credential_definition() != 411: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_did() != 9418: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_schema() != 37103: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_get_receipt() != 56453: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_ping() != 64834: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_query_events() != 44751: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_submit_transaction() != 37630: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_get_signing_bytes() != 1239: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_set_signature() != 39952: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_method_transactionendorsingdata_get_signing_bytes() != 64283: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_eventquery_new() != 57276: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_ledgerclient_new() != 17350: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_transaction_new() != 38765: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + + +# Define FFI callback types +UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK = ctypes.CFUNCTYPE(None,ctypes.c_size_t,ctypes.c_int8, +) +UNIFFI_CALLBACK_INTERFACE_FREE = ctypes.CFUNCTYPE(None,ctypes.c_uint64, +) + +# Define FFI structs + +# A ctypes library to expose the extern-C FFI definitions. +# This is an implementation detail which will be called internally by the public API. + +_UniffiLib = _uniffi_load_indirect() +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_eventquery.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_eventquery.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_eventquery.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_eventquery.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_eventquery_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_eventquery_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_ledgerclient.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_ledgerclient.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_ledgerclient.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_ledgerclient.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_ledgerclient_new.argtypes = ( + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_ledgerclient_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_get_receipt.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_get_receipt.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_ping.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_ping.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_query_events.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_query_events.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_submit_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.c_void_p, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_submit_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transaction.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_transaction_new.argtypes = ( + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_transaction_new.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_get_signing_bytes.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_get_signing_bytes.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_set_signature.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_set_signature.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transactionendorsingdata.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transactionendorsingdata.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transactionendorsingdata.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transactionendorsingdata.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transactionendorsingdata_get_signing_bytes.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transactionendorsingdata_get_signing_bytes.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_add_validator_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_add_validator_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_assign_role_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.c_uint8, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_assign_role_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_endorsing_data.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_endorsing_data.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_signed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_signed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, + ctypes.c_uint64, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_created_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_created_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_query.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_query.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_changed_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_changed_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_events_query.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_events_query.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_owner_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_owner_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_identity_nonce_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_identity_nonce_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_role_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_role_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_created_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_created_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_query.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_query.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_validators_transaction.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_validators_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_has_role_transaction.argtypes = ( + ctypes.c_void_p, + ctypes.c_uint8, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_has_role_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_remove_validator_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_remove_validator_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_revoke_role_transaction.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.c_uint8, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_revoke_role_transaction.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_event.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_event.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_result.restype = ctypes.c_uint64 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_attribute_changed_event_response.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_attribute_changed_event_response.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_changed_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_changed_result.restype = ctypes.c_uint64 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_delegate_changed_event_response.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_delegate_changed_event_response.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_event_response.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_event_response.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_changed_event_response.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_changed_event_response.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_result.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_role_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_role_result.restype = ctypes.c_uint8 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_validators_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_validators_result.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_has_role_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_has_role_result.restype = ctypes.c_int8 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_event.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_event.restype = _UniffiRustBuffer +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_result.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_result.restype = ctypes.c_uint64 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_credential_definition.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_credential_definition.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_did.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_did.restype = ctypes.c_void_p +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_schema.argtypes = ( + ctypes.c_void_p, + _UniffiRustBuffer, +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_schema.restype = ctypes.c_void_p +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_alloc.argtypes = ( + ctypes.c_int32, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_alloc.restype = _UniffiRustBuffer +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_from_bytes.argtypes = ( + _UniffiForeignBytes, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_from_bytes.restype = _UniffiRustBuffer +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_free.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_free.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_reserve.argtypes = ( + _UniffiRustBuffer, + ctypes.c_int32, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rustbuffer_reserve.restype = _UniffiRustBuffer +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u8.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u8.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u8.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u8.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u8.restype = ctypes.c_uint8 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i8.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i8.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i8.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i8.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i8.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i8.restype = ctypes.c_int8 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u16.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u16.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u16.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u16.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u16.restype = ctypes.c_uint16 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i16.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i16.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i16.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i16.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i16.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i16.restype = ctypes.c_int16 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u32.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u32.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u32.restype = ctypes.c_uint32 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i32.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i32.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i32.restype = ctypes.c_int32 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u64.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_u64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_u64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_u64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u64.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_u64.restype = ctypes.c_uint64 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i64.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_i64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_i64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_i64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i64.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_i64.restype = ctypes.c_int64 +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_f32.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_f32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_f32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_f32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_f32.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_f32.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_f32.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_f32.restype = ctypes.c_float +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_f64.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_f64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_f64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_f64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_f64.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_f64.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_f64.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_f64.restype = ctypes.c_double +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_pointer.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_pointer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer.restype = ctypes.c_void_p +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_rust_buffer.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_rust_buffer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer.restype = _UniffiRustBuffer +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_void.argtypes = ( + ctypes.c_void_p, + UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK, + ctypes.c_size_t, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_void.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_void.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_cancel_void.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_void.argtypes = ( + ctypes.c_void_p, +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_void.restype = None +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_void.argtypes = ( + ctypes.c_void_p, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_void.restype = None +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_add_validator_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_add_validator_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_assign_role_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_assign_role_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_credential_definition_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_create_schema_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_add_delegate_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_change_owner_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_attribute_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_revoke_delegate_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_endorsing_data.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_endorsing_data.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_signed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_signed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_did_set_attribute_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_created_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_created_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_query.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_credential_definition_query.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_changed_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_changed_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_events_query.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_events_query.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_owner_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_did_owner_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_identity_nonce_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_identity_nonce_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_role_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_role_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_created_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_created_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_query.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_schema_query.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_validators_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_get_validators_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_has_role_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_has_role_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_remove_validator_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_remove_validator_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_revoke_role_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_build_revoke_role_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_event.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_event.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_credential_definition_created_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_attribute_changed_event_response.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_attribute_changed_event_response.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_changed_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_changed_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_delegate_changed_event_response.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_delegate_changed_event_response.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_event_response.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_event_response.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_changed_event_response.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_changed_event_response.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_did_owner_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_role_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_role_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_validators_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_get_validators_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_has_role_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_has_role_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_event.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_event.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_result.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_parse_schema_created_result.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_credential_definition.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_credential_definition.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_did.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_did.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_schema.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_func_resolve_schema.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_get_receipt.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_get_receipt.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_ping.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_ping.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_query_events.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_query_events.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_submit_transaction.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_ledgerclient_submit_transaction.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_get_signing_bytes.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_get_signing_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_set_signature.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transaction_set_signature.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transactionendorsingdata_get_signing_bytes.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_method_transactionendorsingdata_get_signing_bytes.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_eventquery_new.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_eventquery_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_ledgerclient_new.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_ledgerclient_new.restype = ctypes.c_uint16 +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_transaction_new.argtypes = ( +) +_UniffiLib.uniffi_indy_besu_vdr_uniffi_checksum_constructor_transaction_new.restype = ctypes.c_uint16 +_UniffiLib.ffi_indy_besu_vdr_uniffi_uniffi_contract_version.argtypes = ( +) +_UniffiLib.ffi_indy_besu_vdr_uniffi_uniffi_contract_version.restype = ctypes.c_uint32 +_uniffi_check_contract_api_version(_UniffiLib) +_uniffi_check_api_checksums(_UniffiLib) + +# Async support# RustFuturePoll values +_UNIFFI_RUST_FUTURE_POLL_READY = 0 +_UNIFFI_RUST_FUTURE_POLL_MAYBE_READY = 1 + +# Stores futures for _uniffi_continuation_callback +_UniffiContinuationPointerManager = _UniffiPointerManager() + +# Continuation callback for async functions +# lift the return value or error and resolve the future, causing the async function to resume. +@UNIFFI_RUST_FUTURE_CONTINUATION_CALLBACK +def _uniffi_continuation_callback(future_ptr, poll_code): + (eventloop, future) = _UniffiContinuationPointerManager.release_pointer(future_ptr) + eventloop.call_soon_threadsafe(_uniffi_set_future_result, future, poll_code) + +def _uniffi_set_future_result(future, poll_code): + if not future.cancelled(): + future.set_result(poll_code) + +async def _uniffi_rust_call_async(rust_future, ffi_poll, ffi_complete, ffi_free, lift_func, error_ffi_converter): + try: + eventloop = asyncio.get_running_loop() + + # Loop and poll until we see a _UNIFFI_RUST_FUTURE_POLL_READY value + while True: + future = eventloop.create_future() + ffi_poll( + rust_future, + _uniffi_continuation_callback, + _UniffiContinuationPointerManager.new_pointer((eventloop, future)), + ) + poll_code = await future + if poll_code == _UNIFFI_RUST_FUTURE_POLL_READY: + break + + return lift_func( + _rust_call_with_error(error_ffi_converter, ffi_complete, rust_future) + ) + finally: + ffi_free(rust_future) + +# Public interface members begin here. + + +class _UniffiConverterUInt8(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u8" + VALUE_MIN = 0 + VALUE_MAX = 2**8 + + @staticmethod + def read(buf): + return buf.read_u8() + + @staticmethod + def write(value, buf): + buf.write_u8(value) + +class _UniffiConverterUInt64(_UniffiConverterPrimitiveInt): + CLASS_NAME = "u64" + VALUE_MIN = 0 + VALUE_MAX = 2**64 + + @staticmethod + def read(buf): + return buf.read_u64() + + @staticmethod + def write(value, buf): + buf.write_u64(value) + +class _UniffiConverterBool: + @classmethod + def check_lower(cls, value): + return not not value + + @classmethod + def lower(cls, value): + return 1 if value else 0 + + @staticmethod + def lift(value): + return value != 0 + + @classmethod + def read(cls, buf): + return cls.lift(buf.read_u8()) + + @classmethod + def write(cls, value, buf): + buf.write_u8(value) + +class _UniffiConverterString: + @staticmethod + def check_lower(value): + if not isinstance(value, str): + raise TypeError("argument must be str, not {}".format(type(value).__name__)) + return value + + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative string length") + utf8_bytes = buf.read(size) + return utf8_bytes.decode("utf-8") + + @staticmethod + def write(value, buf): + utf8_bytes = value.encode("utf-8") + buf.write_i32(len(utf8_bytes)) + buf.write(utf8_bytes) + + @staticmethod + def lift(buf): + with buf.consume_with_stream() as stream: + return stream.read(stream.remaining()).decode("utf-8") + + @staticmethod + def lower(value): + with _UniffiRustBuffer.alloc_with_builder() as builder: + builder.write(value.encode("utf-8")) + return builder.finalize() + +class _UniffiConverterBytes(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + size = buf.read_i32() + if size < 0: + raise InternalError("Unexpected negative byte string length") + return buf.read(size) + + @staticmethod + def check_lower(value): + try: + memoryview(value) + except TypeError: + raise TypeError("a bytes-like object is required, not {!r}".format(type(value).__name__)) + + @staticmethod + def write(value, buf): + buf.write_i32(len(value)) + buf.write(value) + + + +class EventQueryProtocol(typing.Protocol): + pass + +class EventQuery: + + _pointer: ctypes.c_void_p + def __init__(self, address: "str",from_block: "typing.Optional[int]",to_block: "typing.Optional[int]",event_signature: "typing.Optional[str]",event_filter: "typing.Optional[str]"): + _UniffiConverterString.check_lower(address) + + _UniffiConverterOptionalUInt64.check_lower(from_block) + + _UniffiConverterOptionalUInt64.check_lower(to_block) + + _UniffiConverterOptionalString.check_lower(event_signature) + + _UniffiConverterOptionalString.check_lower(event_filter) + + self._pointer = _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_eventquery_new, + _UniffiConverterString.lower(address), + _UniffiConverterOptionalUInt64.lower(from_block), + _UniffiConverterOptionalUInt64.lower(to_block), + _UniffiConverterOptionalString.lower(event_signature), + _UniffiConverterOptionalString.lower(event_filter)) + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_eventquery, pointer) + + def _uniffi_clone_pointer(self): + return _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_eventquery, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + +class _UniffiConverterTypeEventQuery: + + @staticmethod + def lift(value: int): + return EventQuery._make_instance_(value) + + @staticmethod + def check_lower(value: EventQuery): + if not isinstance(value, EventQuery): + raise TypeError("Expected EventQuery instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: EventQueryProtocol): + if not isinstance(value, EventQuery): + raise TypeError("Expected EventQuery instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: EventQueryProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + + +class LedgerClientProtocol(typing.Protocol): + def get_receipt(self, hash: "bytes"): + raise NotImplementedError + def ping(self, ): + raise NotImplementedError + def query_events(self, query: "EventQuery"): + raise NotImplementedError + def submit_transaction(self, transaction: "Transaction"): + raise NotImplementedError + +class LedgerClient: + + _pointer: ctypes.c_void_p + def __init__(self, chain_id: "int",node_address: "str",contract_configs: "typing.List[ContractConfig]",quorum_config: "typing.Optional[QuorumConfig]"): + _UniffiConverterUInt64.check_lower(chain_id) + + _UniffiConverterString.check_lower(node_address) + + _UniffiConverterSequenceTypeContractConfig.check_lower(contract_configs) + + _UniffiConverterOptionalTypeQuorumConfig.check_lower(quorum_config) + + self._pointer = _rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_ledgerclient_new, + _UniffiConverterUInt64.lower(chain_id), + _UniffiConverterString.lower(node_address), + _UniffiConverterSequenceTypeContractConfig.lower(contract_configs), + _UniffiConverterOptionalTypeQuorumConfig.lower(quorum_config)) + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_ledgerclient, pointer) + + def _uniffi_clone_pointer(self): + return _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_ledgerclient, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + + + def get_receipt(self, hash: "bytes"): + _UniffiConverterBytes.check_lower(hash) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_get_receipt( + self._uniffi_clone_pointer(), + _UniffiConverterBytes.lower(hash) + ), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterString.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + + + + + + def ping(self, ): + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_ping( + self._uniffi_clone_pointer(), + ), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterTypePingStatus.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + + + + + + def query_events(self, query: "EventQuery"): + _UniffiConverterTypeEventQuery.check_lower(query) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_query_events( + self._uniffi_clone_pointer(), + _UniffiConverterTypeEventQuery.lower(query) + ), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterSequenceTypeEventLog.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + + + + + + def submit_transaction(self, transaction: "Transaction"): + _UniffiConverterTypeTransaction.check_lower(transaction) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_ledgerclient_submit_transaction( + self._uniffi_clone_pointer(), + _UniffiConverterTypeTransaction.lower(transaction) + ), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterBytes.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + + + + +class _UniffiConverterTypeLedgerClient: + + @staticmethod + def lift(value: int): + return LedgerClient._make_instance_(value) + + @staticmethod + def check_lower(value: LedgerClient): + if not isinstance(value, LedgerClient): + raise TypeError("Expected LedgerClient instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: LedgerClientProtocol): + if not isinstance(value, LedgerClient): + raise TypeError("Expected LedgerClient instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: LedgerClientProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + + +class TransactionProtocol(typing.Protocol): + def get_signing_bytes(self, ): + raise NotImplementedError + def set_signature(self, signature_data: "SignatureData"): + raise NotImplementedError + +class Transaction: + + _pointer: ctypes.c_void_p + def __init__(self, type: "TransactionType",_from: "typing.Optional[str]",to: "str",chain_id: "int",data: "bytes",nonce: "typing.Optional[int]",signature: "typing.Optional[TransactionSignature]"): + _UniffiConverterTypeTransactionType.check_lower(type) + + _UniffiConverterOptionalString.check_lower(_from) + + _UniffiConverterString.check_lower(to) + + _UniffiConverterUInt64.check_lower(chain_id) + + _UniffiConverterBytes.check_lower(data) + + _UniffiConverterOptionalUInt64.check_lower(nonce) + + _UniffiConverterOptionalTypeTransactionSignature.check_lower(signature) + + self._pointer = _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_constructor_transaction_new, + _UniffiConverterTypeTransactionType.lower(type), + _UniffiConverterOptionalString.lower(_from), + _UniffiConverterString.lower(to), + _UniffiConverterUInt64.lower(chain_id), + _UniffiConverterBytes.lower(data), + _UniffiConverterOptionalUInt64.lower(nonce), + _UniffiConverterOptionalTypeTransactionSignature.lower(signature)) + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transaction, pointer) + + def _uniffi_clone_pointer(self): + return _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transaction, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + + + def get_signing_bytes(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _rust_call_with_error( + _UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_get_signing_bytes,self._uniffi_clone_pointer(),) + ) + + + + + + + def set_signature(self, signature_data: "SignatureData"): + _UniffiConverterTypeSignatureData.check_lower(signature_data) + + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transaction_set_signature,self._uniffi_clone_pointer(), + _UniffiConverterTypeSignatureData.lower(signature_data)) + + + + + + +class _UniffiConverterTypeTransaction: + + @staticmethod + def lift(value: int): + return Transaction._make_instance_(value) + + @staticmethod + def check_lower(value: Transaction): + if not isinstance(value, Transaction): + raise TypeError("Expected Transaction instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TransactionProtocol): + if not isinstance(value, Transaction): + raise TypeError("Expected Transaction instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: TransactionProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + + +class TransactionEndorsingDataProtocol(typing.Protocol): + def get_signing_bytes(self, ): + raise NotImplementedError + +class TransactionEndorsingData: + + _pointer: ctypes.c_void_p + + def __del__(self): + # In case of partial initialization of instances. + pointer = getattr(self, "_pointer", None) + if pointer is not None: + _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_free_transactionendorsingdata, pointer) + + def _uniffi_clone_pointer(self): + return _rust_call(_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_clone_transactionendorsingdata, self._pointer) + + # Used by alternative constructors or any methods which return this type. + @classmethod + def _make_instance_(cls, pointer): + # Lightly yucky way to bypass the usual __init__ logic + # and just create a new instance with the required pointer. + inst = cls.__new__(cls) + inst._pointer = pointer + return inst + + + def get_signing_bytes(self, ) -> "bytes": + return _UniffiConverterBytes.lift( + _rust_call_with_error( + _UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_method_transactionendorsingdata_get_signing_bytes,self._uniffi_clone_pointer(),) + ) + + + + + +class _UniffiConverterTypeTransactionEndorsingData: + + @staticmethod + def lift(value: int): + return TransactionEndorsingData._make_instance_(value) + + @staticmethod + def check_lower(value: TransactionEndorsingData): + if not isinstance(value, TransactionEndorsingData): + raise TypeError("Expected TransactionEndorsingData instance, {} found".format(type(value).__name__)) + + @staticmethod + def lower(value: TransactionEndorsingDataProtocol): + if not isinstance(value, TransactionEndorsingData): + raise TypeError("Expected TransactionEndorsingData instance, {} found".format(type(value).__name__)) + return value._uniffi_clone_pointer() + + @classmethod + def read(cls, buf: _UniffiRustBuffer): + ptr = buf.read_u64() + if ptr == 0: + raise InternalError("Raw pointer value was null") + return cls.lift(ptr) + + @classmethod + def write(cls, value: TransactionEndorsingDataProtocol, buf: _UniffiRustBuffer): + buf.write_u64(cls.lower(value)) + + +class ContractConfig: + address: "str" + spec_path: "typing.Optional[str]" + spec: "typing.Optional[ContractSpec]" + @typing.no_type_check + def __init__(self, address: "str", spec_path: "typing.Optional[str]", spec: "typing.Optional[ContractSpec]"): + self.address = address + self.spec_path = spec_path + self.spec = spec + + def __str__(self): + return "ContractConfig(address={}, spec_path={}, spec={})".format(self.address, self.spec_path, self.spec) + + def __eq__(self, other): + if self.address != other.address: + return False + if self.spec_path != other.spec_path: + return False + if self.spec != other.spec: + return False + return True + +class _UniffiConverterTypeContractConfig(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ContractConfig( + address=_UniffiConverterString.read(buf), + spec_path=_UniffiConverterOptionalString.read(buf), + spec=_UniffiConverterOptionalTypeContractSpec.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.address) + _UniffiConverterOptionalString.check_lower(value.spec_path) + _UniffiConverterOptionalTypeContractSpec.check_lower(value.spec) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.address, buf) + _UniffiConverterOptionalString.write(value.spec_path, buf) + _UniffiConverterOptionalTypeContractSpec.write(value.spec, buf) + + +class ContractSpec: + name: "str" + abi: "JsonValue" + @typing.no_type_check + def __init__(self, name: "str", abi: "JsonValue"): + self.name = name + self.abi = abi + + def __str__(self): + return "ContractSpec(name={}, abi={})".format(self.name, self.abi) + + def __eq__(self, other): + if self.name != other.name: + return False + if self.abi != other.abi: + return False + return True + +class _UniffiConverterTypeContractSpec(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return ContractSpec( + name=_UniffiConverterString.read(buf), + abi=_UniffiConverterTypeJsonValue.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.name) + _UniffiConverterTypeJsonValue.check_lower(value.abi) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.name, buf) + _UniffiConverterTypeJsonValue.write(value.abi, buf) + + +class DidAttributeChanged: + identity: "str" + name: "str" + value: "bytes" + valid_to: "int" + previous_change: "int" + @typing.no_type_check + def __init__(self, identity: "str", name: "str", value: "bytes", valid_to: "int", previous_change: "int"): + self.identity = identity + self.name = name + self.value = value + self.valid_to = valid_to + self.previous_change = previous_change + + def __str__(self): + return "DidAttributeChanged(identity={}, name={}, value={}, valid_to={}, previous_change={})".format(self.identity, self.name, self.value, self.valid_to, self.previous_change) + + def __eq__(self, other): + if self.identity != other.identity: + return False + if self.name != other.name: + return False + if self.value != other.value: + return False + if self.valid_to != other.valid_to: + return False + if self.previous_change != other.previous_change: + return False + return True + +class _UniffiConverterTypeDidAttributeChanged(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DidAttributeChanged( + identity=_UniffiConverterString.read(buf), + name=_UniffiConverterString.read(buf), + value=_UniffiConverterBytes.read(buf), + valid_to=_UniffiConverterUInt64.read(buf), + previous_change=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.identity) + _UniffiConverterString.check_lower(value.name) + _UniffiConverterBytes.check_lower(value.value) + _UniffiConverterUInt64.check_lower(value.valid_to) + _UniffiConverterUInt64.check_lower(value.previous_change) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.identity, buf) + _UniffiConverterString.write(value.name, buf) + _UniffiConverterBytes.write(value.value, buf) + _UniffiConverterUInt64.write(value.valid_to, buf) + _UniffiConverterUInt64.write(value.previous_change, buf) + + +class DidDelegateChanged: + identity: "str" + delegate: "str" + delegate_type: "bytes" + valid_to: "int" + previous_change: "int" + @typing.no_type_check + def __init__(self, identity: "str", delegate: "str", delegate_type: "bytes", valid_to: "int", previous_change: "int"): + self.identity = identity + self.delegate = delegate + self.delegate_type = delegate_type + self.valid_to = valid_to + self.previous_change = previous_change + + def __str__(self): + return "DidDelegateChanged(identity={}, delegate={}, delegate_type={}, valid_to={}, previous_change={})".format(self.identity, self.delegate, self.delegate_type, self.valid_to, self.previous_change) + + def __eq__(self, other): + if self.identity != other.identity: + return False + if self.delegate != other.delegate: + return False + if self.delegate_type != other.delegate_type: + return False + if self.valid_to != other.valid_to: + return False + if self.previous_change != other.previous_change: + return False + return True + +class _UniffiConverterTypeDidDelegateChanged(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DidDelegateChanged( + identity=_UniffiConverterString.read(buf), + delegate=_UniffiConverterString.read(buf), + delegate_type=_UniffiConverterBytes.read(buf), + valid_to=_UniffiConverterUInt64.read(buf), + previous_change=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.identity) + _UniffiConverterString.check_lower(value.delegate) + _UniffiConverterBytes.check_lower(value.delegate_type) + _UniffiConverterUInt64.check_lower(value.valid_to) + _UniffiConverterUInt64.check_lower(value.previous_change) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.identity, buf) + _UniffiConverterString.write(value.delegate, buf) + _UniffiConverterBytes.write(value.delegate_type, buf) + _UniffiConverterUInt64.write(value.valid_to, buf) + _UniffiConverterUInt64.write(value.previous_change, buf) + + +class DidOwnerChanged: + identity: "str" + owner: "str" + previous_change: "int" + @typing.no_type_check + def __init__(self, identity: "str", owner: "str", previous_change: "int"): + self.identity = identity + self.owner = owner + self.previous_change = previous_change + + def __str__(self): + return "DidOwnerChanged(identity={}, owner={}, previous_change={})".format(self.identity, self.owner, self.previous_change) + + def __eq__(self, other): + if self.identity != other.identity: + return False + if self.owner != other.owner: + return False + if self.previous_change != other.previous_change: + return False + return True + +class _UniffiConverterTypeDidOwnerChanged(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DidOwnerChanged( + identity=_UniffiConverterString.read(buf), + owner=_UniffiConverterString.read(buf), + previous_change=_UniffiConverterUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.identity) + _UniffiConverterString.check_lower(value.owner) + _UniffiConverterUInt64.check_lower(value.previous_change) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.identity, buf) + _UniffiConverterString.write(value.owner, buf) + _UniffiConverterUInt64.write(value.previous_change, buf) + + +class DidResolutionOptions: + accept: "str" + @typing.no_type_check + def __init__(self, accept: "str"): + self.accept = accept + + def __str__(self): + return "DidResolutionOptions(accept={})".format(self.accept) + + def __eq__(self, other): + if self.accept != other.accept: + return False + return True + +class _UniffiConverterTypeDidResolutionOptions(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return DidResolutionOptions( + accept=_UniffiConverterString.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterString.check_lower(value.accept) + + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value.accept, buf) + + +class EventLog: + topics: "typing.List[bytes]" + data: "bytes" + @typing.no_type_check + def __init__(self, topics: "typing.List[bytes]", data: "bytes"): + self.topics = topics + self.data = data + + def __str__(self): + return "EventLog(topics={}, data={})".format(self.topics, self.data) + + def __eq__(self, other): + if self.topics != other.topics: + return False + if self.data != other.data: + return False + return True + +class _UniffiConverterTypeEventLog(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return EventLog( + topics=_UniffiConverterSequenceBytes.read(buf), + data=_UniffiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterSequenceBytes.check_lower(value.topics) + _UniffiConverterBytes.check_lower(value.data) + + @staticmethod + def write(value, buf): + _UniffiConverterSequenceBytes.write(value.topics, buf) + _UniffiConverterBytes.write(value.data, buf) + + +class PingStatus: + status: "Status" + @typing.no_type_check + def __init__(self, status: "Status"): + self.status = status + + def __str__(self): + return "PingStatus(status={})".format(self.status) + + def __eq__(self, other): + if self.status != other.status: + return False + return True + +class _UniffiConverterTypePingStatus(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return PingStatus( + status=_UniffiConverterTypeStatus.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterTypeStatus.check_lower(value.status) + + @staticmethod + def write(value, buf): + _UniffiConverterTypeStatus.write(value.status, buf) + + +class QuorumConfig: + nodes: "typing.List[str]" + request_retries: "typing.Optional[int]" + request_timeout: "typing.Optional[int]" + retry_interval: "typing.Optional[int]" + @typing.no_type_check + def __init__(self, nodes: "typing.List[str]", request_retries: "typing.Optional[int]", request_timeout: "typing.Optional[int]", retry_interval: "typing.Optional[int]"): + self.nodes = nodes + self.request_retries = request_retries + self.request_timeout = request_timeout + self.retry_interval = retry_interval + + def __str__(self): + return "QuorumConfig(nodes={}, request_retries={}, request_timeout={}, retry_interval={})".format(self.nodes, self.request_retries, self.request_timeout, self.retry_interval) + + def __eq__(self, other): + if self.nodes != other.nodes: + return False + if self.request_retries != other.request_retries: + return False + if self.request_timeout != other.request_timeout: + return False + if self.retry_interval != other.retry_interval: + return False + return True + +class _UniffiConverterTypeQuorumConfig(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return QuorumConfig( + nodes=_UniffiConverterSequenceString.read(buf), + request_retries=_UniffiConverterOptionalUInt8.read(buf), + request_timeout=_UniffiConverterOptionalUInt64.read(buf), + retry_interval=_UniffiConverterOptionalUInt64.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterSequenceString.check_lower(value.nodes) + _UniffiConverterOptionalUInt8.check_lower(value.request_retries) + _UniffiConverterOptionalUInt64.check_lower(value.request_timeout) + _UniffiConverterOptionalUInt64.check_lower(value.retry_interval) + + @staticmethod + def write(value, buf): + _UniffiConverterSequenceString.write(value.nodes, buf) + _UniffiConverterOptionalUInt8.write(value.request_retries, buf) + _UniffiConverterOptionalUInt64.write(value.request_timeout, buf) + _UniffiConverterOptionalUInt64.write(value.retry_interval, buf) + + +class SignatureData: + recovery_id: "int" + signature: "bytes" + @typing.no_type_check + def __init__(self, recovery_id: "int", signature: "bytes"): + self.recovery_id = recovery_id + self.signature = signature + + def __str__(self): + return "SignatureData(recovery_id={}, signature={})".format(self.recovery_id, self.signature) + + def __eq__(self, other): + if self.recovery_id != other.recovery_id: + return False + if self.signature != other.signature: + return False + return True + +class _UniffiConverterTypeSignatureData(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return SignatureData( + recovery_id=_UniffiConverterUInt64.read(buf), + signature=_UniffiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterUInt64.check_lower(value.recovery_id) + _UniffiConverterBytes.check_lower(value.signature) + + @staticmethod + def write(value, buf): + _UniffiConverterUInt64.write(value.recovery_id, buf) + _UniffiConverterBytes.write(value.signature, buf) + + +class TransactionSignature: + v: "int" + r: "bytes" + s: "bytes" + @typing.no_type_check + def __init__(self, v: "int", r: "bytes", s: "bytes"): + self.v = v + self.r = r + self.s = s + + def __str__(self): + return "TransactionSignature(v={}, r={}, s={})".format(self.v, self.r, self.s) + + def __eq__(self, other): + if self.v != other.v: + return False + if self.r != other.r: + return False + if self.s != other.s: + return False + return True + +class _UniffiConverterTypeTransactionSignature(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + return TransactionSignature( + v=_UniffiConverterUInt64.read(buf), + r=_UniffiConverterBytes.read(buf), + s=_UniffiConverterBytes.read(buf), + ) + + @staticmethod + def check_lower(value): + _UniffiConverterUInt64.check_lower(value.v) + _UniffiConverterBytes.check_lower(value.r) + _UniffiConverterBytes.check_lower(value.s) + + @staticmethod + def write(value, buf): + _UniffiConverterUInt64.write(value.v, buf) + _UniffiConverterBytes.write(value.r, buf) + _UniffiConverterBytes.write(value.s, buf) + + + + + +class DidEvents: + def __init__(self): + raise RuntimeError("DidEvents cannot be instantiated directly") + + # Each enum variant is a nested class of the enum itself. + class ATTRIBUTE_CHANGED_EVENT: + event: "DidAttributeChanged" + + @typing.no_type_check + def __init__(self,event: "DidAttributeChanged"): + + self.event = event + + + def __str__(self): + return "DidEvents.ATTRIBUTE_CHANGED_EVENT(event={})".format(self.event) + + def __eq__(self, other): + if not other.is_attribute_changed_event(): + return False + if self.event != other.event: + return False + return True + class DELEGATE_CHANGED: + event: "DidDelegateChanged" + + @typing.no_type_check + def __init__(self,event: "DidDelegateChanged"): + + self.event = event + + + def __str__(self): + return "DidEvents.DELEGATE_CHANGED(event={})".format(self.event) + + def __eq__(self, other): + if not other.is_delegate_changed(): + return False + if self.event != other.event: + return False + return True + class OWNER_CHANGED: + event: "DidOwnerChanged" + + @typing.no_type_check + def __init__(self,event: "DidOwnerChanged"): + + self.event = event + + + def __str__(self): + return "DidEvents.OWNER_CHANGED(event={})".format(self.event) + + def __eq__(self, other): + if not other.is_owner_changed(): + return False + if self.event != other.event: + return False + return True + + + # For each variant, we have an `is_NAME` method for easily checking + # whether an instance is that variant. + def is_attribute_changed_event(self) -> bool: + return isinstance(self, DidEvents.ATTRIBUTE_CHANGED_EVENT) + def is_delegate_changed(self) -> bool: + return isinstance(self, DidEvents.DELEGATE_CHANGED) + def is_owner_changed(self) -> bool: + return isinstance(self, DidEvents.OWNER_CHANGED) + + +# Now, a little trick - we make each nested variant class be a subclass of the main +# enum class, so that method calls and instance checks etc will work intuitively. +# We might be able to do this a little more neatly with a metaclass, but this'll do. +DidEvents.ATTRIBUTE_CHANGED_EVENT = type("DidEvents.ATTRIBUTE_CHANGED_EVENT", (DidEvents.ATTRIBUTE_CHANGED_EVENT, DidEvents,), {}) # type: ignore +DidEvents.DELEGATE_CHANGED = type("DidEvents.DELEGATE_CHANGED", (DidEvents.DELEGATE_CHANGED, DidEvents,), {}) # type: ignore +DidEvents.OWNER_CHANGED = type("DidEvents.OWNER_CHANGED", (DidEvents.OWNER_CHANGED, DidEvents,), {}) # type: ignore + + + + +class _UniffiConverterTypeDidEvents(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return DidEvents.ATTRIBUTE_CHANGED_EVENT( + _UniffiConverterTypeDidAttributeChanged.read(buf), + ) + if variant == 2: + return DidEvents.DELEGATE_CHANGED( + _UniffiConverterTypeDidDelegateChanged.read(buf), + ) + if variant == 3: + return DidEvents.OWNER_CHANGED( + _UniffiConverterTypeDidOwnerChanged.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value.is_attribute_changed_event(): + _UniffiConverterTypeDidAttributeChanged.check_lower(value.event) + return + if value.is_delegate_changed(): + _UniffiConverterTypeDidDelegateChanged.check_lower(value.event) + return + if value.is_owner_changed(): + _UniffiConverterTypeDidOwnerChanged.check_lower(value.event) + return + + @staticmethod + def write(value, buf): + if value.is_attribute_changed_event(): + buf.write_i32(1) + _UniffiConverterTypeDidAttributeChanged.write(value.event, buf) + if value.is_delegate_changed(): + buf.write_i32(2) + _UniffiConverterTypeDidDelegateChanged.write(value.event, buf) + if value.is_owner_changed(): + buf.write_i32(3) + _UniffiConverterTypeDidOwnerChanged.write(value.event, buf) + + + + + + + +class Status: + def __init__(self): + raise RuntimeError("Status cannot be instantiated directly") + + # Each enum variant is a nested class of the enum itself. + class OK: + + @typing.no_type_check + def __init__(self,): + + pass + + + def __str__(self): + return "Status.OK()".format() + + def __eq__(self, other): + if not other.is_ok(): + return False + return True + class ERR: + msg: "str" + + @typing.no_type_check + def __init__(self,msg: "str"): + + self.msg = msg + + + def __str__(self): + return "Status.ERR(msg={})".format(self.msg) + + def __eq__(self, other): + if not other.is_err(): + return False + if self.msg != other.msg: + return False + return True + + + # For each variant, we have an `is_NAME` method for easily checking + # whether an instance is that variant. + def is_ok(self) -> bool: + return isinstance(self, Status.OK) + def is_err(self) -> bool: + return isinstance(self, Status.ERR) + + +# Now, a little trick - we make each nested variant class be a subclass of the main +# enum class, so that method calls and instance checks etc will work intuitively. +# We might be able to do this a little more neatly with a metaclass, but this'll do. +Status.OK = type("Status.OK", (Status.OK, Status,), {}) # type: ignore +Status.ERR = type("Status.ERR", (Status.ERR, Status,), {}) # type: ignore + + + + +class _UniffiConverterTypeStatus(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return Status.OK( + ) + if variant == 2: + return Status.ERR( + _UniffiConverterString.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value.is_ok(): + return + if value.is_err(): + _UniffiConverterString.check_lower(value.msg) + return + + @staticmethod + def write(value, buf): + if value.is_ok(): + buf.write_i32(1) + if value.is_err(): + buf.write_i32(2) + _UniffiConverterString.write(value.msg, buf) + + + + + + + +class TransactionType(enum.Enum): + READ = 0 + + WRITE = 1 + + + +class _UniffiConverterTypeTransactionType(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return TransactionType.READ + if variant == 2: + return TransactionType.WRITE + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if value == TransactionType.READ: + return + if value == TransactionType.WRITE: + return + + @staticmethod + def write(value, buf): + if value == TransactionType.READ: + buf.write_i32(1) + if value == TransactionType.WRITE: + buf.write_i32(2) + + + + +# VdrError +# We want to define each variant as a nested class that's also a subclass, +# which is tricky in Python. To accomplish this we're going to create each +# class separately, then manually add the child classes to the base class's +# __dict__. All of this happens in dummy class to avoid polluting the module +# namespace. +class VdrError(Exception): + pass + +_UniffiTempVdrError = VdrError + +class VdrError: # type: ignore + class ClientNodeUnreachable(_UniffiTempVdrError): + + def __init__(self): + pass + def __repr__(self): + return "VdrError.ClientNodeUnreachable({})".format(str(self)) + _UniffiTempVdrError.ClientNodeUnreachable = ClientNodeUnreachable # type: ignore + class ClientInvalidTransaction(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientInvalidTransaction({})".format(str(self)) + _UniffiTempVdrError.ClientInvalidTransaction = ClientInvalidTransaction # type: ignore + class ClientInvalidResponse(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientInvalidResponse({})".format(str(self)) + _UniffiTempVdrError.ClientInvalidResponse = ClientInvalidResponse # type: ignore + class ClientTransactionReverted(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientTransactionReverted({})".format(str(self)) + _UniffiTempVdrError.ClientTransactionReverted = ClientTransactionReverted # type: ignore + class ClientUnexpectedError(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientUnexpectedError({})".format(str(self)) + _UniffiTempVdrError.ClientUnexpectedError = ClientUnexpectedError # type: ignore + class ClientInvalidState(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ClientInvalidState({})".format(str(self)) + _UniffiTempVdrError.ClientInvalidState = ClientInvalidState # type: ignore + class ContractInvalidName(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ContractInvalidName({})".format(str(self)) + _UniffiTempVdrError.ContractInvalidName = ContractInvalidName # type: ignore + class ContractInvalidSpec(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ContractInvalidSpec({})".format(str(self)) + _UniffiTempVdrError.ContractInvalidSpec = ContractInvalidSpec # type: ignore + class ContractInvalidInputData(_UniffiTempVdrError): + + def __init__(self): + pass + def __repr__(self): + return "VdrError.ContractInvalidInputData({})".format(str(self)) + _UniffiTempVdrError.ContractInvalidInputData = ContractInvalidInputData # type: ignore + class ContractInvalidResponseData(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.ContractInvalidResponseData({})".format(str(self)) + _UniffiTempVdrError.ContractInvalidResponseData = ContractInvalidResponseData # type: ignore + class SignerInvalidPrivateKey(_UniffiTempVdrError): + + def __init__(self): + pass + def __repr__(self): + return "VdrError.SignerInvalidPrivateKey({})".format(str(self)) + _UniffiTempVdrError.SignerInvalidPrivateKey = SignerInvalidPrivateKey # type: ignore + class SignerInvalidMessage(_UniffiTempVdrError): + + def __init__(self): + pass + def __repr__(self): + return "VdrError.SignerInvalidMessage({})".format(str(self)) + _UniffiTempVdrError.SignerInvalidMessage = SignerInvalidMessage # type: ignore + class SignerMissingKey(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.SignerMissingKey({})".format(str(self)) + _UniffiTempVdrError.SignerMissingKey = SignerMissingKey # type: ignore + class SignerUnexpectedError(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.SignerUnexpectedError({})".format(str(self)) + _UniffiTempVdrError.SignerUnexpectedError = SignerUnexpectedError # type: ignore + class CommonInvalidData(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.CommonInvalidData({})".format(str(self)) + _UniffiTempVdrError.CommonInvalidData = CommonInvalidData # type: ignore + class QuorumNotReached(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.QuorumNotReached({})".format(str(self)) + _UniffiTempVdrError.QuorumNotReached = QuorumNotReached # type: ignore + class GetTransactionError(_UniffiTempVdrError): + + def __init__(self, msg): + super().__init__(", ".join([ + "msg={!r}".format(msg), + ])) + self.msg = msg + def __repr__(self): + return "VdrError.GetTransactionError({})".format(str(self)) + _UniffiTempVdrError.GetTransactionError = GetTransactionError # type: ignore + +VdrError = _UniffiTempVdrError # type: ignore +del _UniffiTempVdrError + + +class _UniffiConverterTypeVdrError(_UniffiConverterRustBuffer): + @staticmethod + def read(buf): + variant = buf.read_i32() + if variant == 1: + return VdrError.ClientNodeUnreachable( + ) + if variant == 2: + return VdrError.ClientInvalidTransaction( + msg=_UniffiConverterString.read(buf), + ) + if variant == 3: + return VdrError.ClientInvalidResponse( + msg=_UniffiConverterString.read(buf), + ) + if variant == 4: + return VdrError.ClientTransactionReverted( + msg=_UniffiConverterString.read(buf), + ) + if variant == 5: + return VdrError.ClientUnexpectedError( + msg=_UniffiConverterString.read(buf), + ) + if variant == 6: + return VdrError.ClientInvalidState( + msg=_UniffiConverterString.read(buf), + ) + if variant == 7: + return VdrError.ContractInvalidName( + msg=_UniffiConverterString.read(buf), + ) + if variant == 8: + return VdrError.ContractInvalidSpec( + msg=_UniffiConverterString.read(buf), + ) + if variant == 9: + return VdrError.ContractInvalidInputData( + ) + if variant == 10: + return VdrError.ContractInvalidResponseData( + msg=_UniffiConverterString.read(buf), + ) + if variant == 11: + return VdrError.SignerInvalidPrivateKey( + ) + if variant == 12: + return VdrError.SignerInvalidMessage( + ) + if variant == 13: + return VdrError.SignerMissingKey( + msg=_UniffiConverterString.read(buf), + ) + if variant == 14: + return VdrError.SignerUnexpectedError( + msg=_UniffiConverterString.read(buf), + ) + if variant == 15: + return VdrError.CommonInvalidData( + msg=_UniffiConverterString.read(buf), + ) + if variant == 16: + return VdrError.QuorumNotReached( + msg=_UniffiConverterString.read(buf), + ) + if variant == 17: + return VdrError.GetTransactionError( + msg=_UniffiConverterString.read(buf), + ) + raise InternalError("Raw enum value doesn't match any cases") + + @staticmethod + def check_lower(value): + if isinstance(value, VdrError.ClientNodeUnreachable): + return + if isinstance(value, VdrError.ClientInvalidTransaction): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ClientInvalidResponse): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ClientTransactionReverted): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ClientUnexpectedError): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ClientInvalidState): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ContractInvalidName): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ContractInvalidSpec): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.ContractInvalidInputData): + return + if isinstance(value, VdrError.ContractInvalidResponseData): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.SignerInvalidPrivateKey): + return + if isinstance(value, VdrError.SignerInvalidMessage): + return + if isinstance(value, VdrError.SignerMissingKey): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.SignerUnexpectedError): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.CommonInvalidData): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.QuorumNotReached): + _UniffiConverterString.check_lower(value.msg) + return + if isinstance(value, VdrError.GetTransactionError): + _UniffiConverterString.check_lower(value.msg) + return + + @staticmethod + def write(value, buf): + if isinstance(value, VdrError.ClientNodeUnreachable): + buf.write_i32(1) + if isinstance(value, VdrError.ClientInvalidTransaction): + buf.write_i32(2) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ClientInvalidResponse): + buf.write_i32(3) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ClientTransactionReverted): + buf.write_i32(4) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ClientUnexpectedError): + buf.write_i32(5) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ClientInvalidState): + buf.write_i32(6) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ContractInvalidName): + buf.write_i32(7) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ContractInvalidSpec): + buf.write_i32(8) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.ContractInvalidInputData): + buf.write_i32(9) + if isinstance(value, VdrError.ContractInvalidResponseData): + buf.write_i32(10) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.SignerInvalidPrivateKey): + buf.write_i32(11) + if isinstance(value, VdrError.SignerInvalidMessage): + buf.write_i32(12) + if isinstance(value, VdrError.SignerMissingKey): + buf.write_i32(13) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.SignerUnexpectedError): + buf.write_i32(14) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.CommonInvalidData): + buf.write_i32(15) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.QuorumNotReached): + buf.write_i32(16) + _UniffiConverterString.write(value.msg, buf) + if isinstance(value, VdrError.GetTransactionError): + buf.write_i32(17) + _UniffiConverterString.write(value.msg, buf) + + + +class _UniffiConverterOptionalUInt8(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterUInt8.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterUInt8.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterUInt8.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalUInt64(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterUInt64.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterUInt64.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterUInt64.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterString.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterString.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterString.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeContractSpec(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeContractSpec.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeContractSpec.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeContractSpec.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeDidResolutionOptions(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeDidResolutionOptions.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeDidResolutionOptions.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeDidResolutionOptions.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeQuorumConfig(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeQuorumConfig.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeQuorumConfig.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeQuorumConfig.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterOptionalTypeTransactionSignature(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + if value is not None: + _UniffiConverterTypeTransactionSignature.check_lower(value) + + @classmethod + def write(cls, value, buf): + if value is None: + buf.write_u8(0) + return + + buf.write_u8(1) + _UniffiConverterTypeTransactionSignature.write(value, buf) + + @classmethod + def read(cls, buf): + flag = buf.read_u8() + if flag == 0: + return None + elif flag == 1: + return _UniffiConverterTypeTransactionSignature.read(buf) + else: + raise InternalError("Unexpected flag byte for optional type") + + + +class _UniffiConverterSequenceString(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterString.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterString.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterString.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceBytes(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterBytes.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterBytes.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterBytes.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeContractConfig(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeContractConfig.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeContractConfig.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeContractConfig.read(buf) for i in range(count) + ] + + + +class _UniffiConverterSequenceTypeEventLog(_UniffiConverterRustBuffer): + @classmethod + def check_lower(cls, value): + for item in value: + _UniffiConverterTypeEventLog.check_lower(item) + + @classmethod + def write(cls, value, buf): + items = len(value) + buf.write_i32(items) + for item in value: + _UniffiConverterTypeEventLog.write(item, buf) + + @classmethod + def read(cls, buf): + count = buf.read_i32() + if count < 0: + raise InternalError("Unexpected negative sequence length") + + return [ + _UniffiConverterTypeEventLog.read(buf) for i in range(count) + ] + + +# Type alias +JsonValue = str + +class _UniffiConverterTypeJsonValue: + @staticmethod + def write(value, buf): + _UniffiConverterString.write(value, buf) + + @staticmethod + def read(buf): + return _UniffiConverterString.read(buf) + + @staticmethod + def lift(value): + return _UniffiConverterString.lift(value) + + @staticmethod + def check_lower(value): + return _UniffiConverterString.check_lower(value) + + @staticmethod + def lower(value): + return _UniffiConverterString.lower(value) + +def build_add_validator_transaction(client: "LedgerClient",_from: "str",validator_address: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(validator_address) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_add_validator_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(validator_address)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_assign_role_transaction(client: "LedgerClient",_from: "str",role: "int",account: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterUInt8.check_lower(role) + + _UniffiConverterString.check_lower(account) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_assign_role_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterUInt8.lower(role), + _UniffiConverterString.lower(account)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_credential_definition_endorsing_data(client: "LedgerClient",id: "str",credential_definition: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(credential_definition) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(credential_definition)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_credential_definition_signed_transaction(client: "LedgerClient",_from: "str",id: "str",credential_definition: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(credential_definition) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(credential_definition), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_credential_definition_transaction(client: "LedgerClient",_from: "str",id: "str",credential_definition: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(credential_definition) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_credential_definition_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(credential_definition)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_schema_endorsing_data(client: "LedgerClient",id: "str",schema: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(schema) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(schema)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_schema_signed_transaction(client: "LedgerClient",_from: "str",id: "str",schema: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(schema) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(schema), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_create_schema_transaction(client: "LedgerClient",_from: "str",id: "str",schema: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterString.check_lower(schema) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_create_schema_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(id), + _UniffiConverterString.lower(schema)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_add_delegate_endorsing_data(client: "LedgerClient",did: "str",delegate_type: "str",delegate: "str",validity: "int"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + _UniffiConverterUInt64.check_lower(validity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate), + _UniffiConverterUInt64.lower(validity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_add_delegate_signed_transaction(client: "LedgerClient",_from: "str",did: "str",delegate_type: "str",delegate: "str",validity: "int",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + _UniffiConverterUInt64.check_lower(validity) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate), + _UniffiConverterUInt64.lower(validity), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_add_delegate_transaction(client: "LedgerClient",_from: "str",did: "str",delegate_type: "str",delegate: "str",validity: "int"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + _UniffiConverterUInt64.check_lower(validity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_add_delegate_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate), + _UniffiConverterUInt64.lower(validity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_change_owner_endorsing_data(client: "LedgerClient",did: "str",new_owner: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(new_owner) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(new_owner)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_change_owner_signed_transaction(client: "LedgerClient",_from: "str",did: "str",new_owner: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(new_owner) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(new_owner), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_change_owner_transaction(client: "LedgerClient",_from: "str",did: "str",new_owner: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(new_owner) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_change_owner_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(new_owner)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_attribute_endorsing_data(client: "LedgerClient",did: "str",attribute: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_attribute_signed_transaction(client: "LedgerClient",_from: "str",did: "str",attribute: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_attribute_transaction(client: "LedgerClient",_from: "str",did: "str",attribute: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_attribute_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_delegate_endorsing_data(client: "LedgerClient",did: "str",delegate_type: "str",delegate: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_delegate_signed_transaction(client: "LedgerClient",_from: "str",did: "str",delegate_type: "str",delegate: "str",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_revoke_delegate_transaction(client: "LedgerClient",_from: "str",did: "str",delegate_type: "str",delegate: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(delegate_type) + + _UniffiConverterString.check_lower(delegate) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_revoke_delegate_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(delegate_type), + _UniffiConverterString.lower(delegate)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_set_attribute_endorsing_data(client: "LedgerClient",did: "str",attribute: "str",validity: "int"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + _UniffiConverterUInt64.check_lower(validity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_endorsing_data( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute), + _UniffiConverterUInt64.lower(validity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransactionEndorsingData.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_set_attribute_signed_transaction(client: "LedgerClient",_from: "str",did: "str",attribute: "str",validity: "int",signature: "SignatureData"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + _UniffiConverterUInt64.check_lower(validity) + + _UniffiConverterTypeSignatureData.check_lower(signature) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_signed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute), + _UniffiConverterUInt64.lower(validity), + _UniffiConverterTypeSignatureData.lower(signature)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_did_set_attribute_transaction(client: "LedgerClient",_from: "str",did: "str",attribute: "str",validity: "int"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterString.check_lower(attribute) + + _UniffiConverterUInt64.check_lower(validity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_did_set_attribute_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(did), + _UniffiConverterString.lower(attribute), + _UniffiConverterUInt64.lower(validity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_credential_definition_created_transaction(client: "LedgerClient",id: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_created_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_credential_definition_query(client: "LedgerClient",id: "str",from_block: "typing.Optional[int]",to_block: "typing.Optional[int]"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterOptionalUInt64.check_lower(from_block) + + _UniffiConverterOptionalUInt64.check_lower(to_block) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_credential_definition_query( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id), + _UniffiConverterOptionalUInt64.lower(from_block), + _UniffiConverterOptionalUInt64.lower(to_block)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeEventQuery.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_did_changed_transaction(client: "LedgerClient",did: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_changed_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_did_events_query(client: "LedgerClient",did: "str",from_block: "typing.Optional[int]",to_block: "typing.Optional[int]"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterOptionalUInt64.check_lower(from_block) + + _UniffiConverterOptionalUInt64.check_lower(to_block) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_events_query( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterOptionalUInt64.lower(from_block), + _UniffiConverterOptionalUInt64.lower(to_block)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeEventQuery.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_did_owner_transaction(client: "LedgerClient",did: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_did_owner_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_identity_nonce_transaction(client: "LedgerClient",identity: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(identity) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_identity_nonce_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(identity)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_role_transaction(client: "LedgerClient",account: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(account) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_role_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(account)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_schema_created_transaction(client: "LedgerClient",id: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_created_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_schema_query(client: "LedgerClient",id: "str",from_block: "typing.Optional[int]",to_block: "typing.Optional[int]"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + _UniffiConverterOptionalUInt64.check_lower(from_block) + + _UniffiConverterOptionalUInt64.check_lower(to_block) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_schema_query( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id), + _UniffiConverterOptionalUInt64.lower(from_block), + _UniffiConverterOptionalUInt64.lower(to_block)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeEventQuery.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_get_validators_transaction(client: "LedgerClient"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_get_validators_transaction( + _UniffiConverterTypeLedgerClient.lower(client)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_has_role_transaction(client: "LedgerClient",role: "int",account: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterUInt8.check_lower(role) + + _UniffiConverterString.check_lower(account) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_has_role_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterUInt8.lower(role), + _UniffiConverterString.lower(account)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_remove_validator_transaction(client: "LedgerClient",_from: "str",validator_address: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterString.check_lower(validator_address) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_remove_validator_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterString.lower(validator_address)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def build_revoke_role_transaction(client: "LedgerClient",_from: "str",role: "int",account: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(_from) + + _UniffiConverterUInt8.check_lower(role) + + _UniffiConverterString.check_lower(account) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_build_revoke_role_transaction( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(_from), + _UniffiConverterUInt8.lower(role), + _UniffiConverterString.lower(account)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_pointer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_pointer, + # lift function + _UniffiConverterTypeTransaction.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def parse_credential_definition_created_event(client: "LedgerClient",log: "EventLog") -> "str": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_event, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_credential_definition_created_result(client: "LedgerClient",bytes: "bytes") -> "int": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterUInt64.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_credential_definition_created_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_did_attribute_changed_event_response(client: "LedgerClient",log: "EventLog") -> "DidAttributeChanged": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterTypeDidAttributeChanged.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_attribute_changed_event_response, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_did_changed_result(client: "LedgerClient",bytes: "bytes") -> "int": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterUInt64.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_changed_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_did_delegate_changed_event_response(client: "LedgerClient",log: "EventLog") -> "DidDelegateChanged": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterTypeDidDelegateChanged.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_delegate_changed_event_response, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_did_event_response(client: "LedgerClient",log: "EventLog") -> "DidEvents": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterTypeDidEvents.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_event_response, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_did_owner_changed_event_response(client: "LedgerClient",log: "EventLog") -> "DidOwnerChanged": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterTypeDidOwnerChanged.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_changed_event_response, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_did_owner_result(client: "LedgerClient",bytes: "bytes") -> "str": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_did_owner_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_get_role_result(client: "LedgerClient",bytes: "bytes") -> "int": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterUInt8.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_role_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_get_validators_result(client: "LedgerClient",bytes: "bytes") -> "str": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_get_validators_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_has_role_result(client: "LedgerClient",bytes: "bytes") -> "bool": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterBool.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_has_role_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def parse_schema_created_event(client: "LedgerClient",log: "EventLog") -> "str": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterTypeEventLog.check_lower(log) + + return _UniffiConverterString.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_event, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterTypeEventLog.lower(log))) + + +def parse_schema_created_result(client: "LedgerClient",bytes: "bytes") -> "int": + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterBytes.check_lower(bytes) + + return _UniffiConverterUInt64.lift(_rust_call_with_error(_UniffiConverterTypeVdrError,_UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_parse_schema_created_result, + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterBytes.lower(bytes))) + + +def resolve_credential_definition(client: "LedgerClient",id: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_credential_definition( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterString.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def resolve_did(client: "LedgerClient",did: "str",options: "typing.Optional[DidResolutionOptions]"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(did) + + _UniffiConverterOptionalTypeDidResolutionOptions.check_lower(options) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_did( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(did), + _UniffiConverterOptionalTypeDidResolutionOptions.lower(options)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterString.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +def resolve_schema(client: "LedgerClient",id: "str"): + _UniffiConverterTypeLedgerClient.check_lower(client) + + _UniffiConverterString.check_lower(id) + + return _uniffi_rust_call_async( + _UniffiLib.uniffi_indy_besu_vdr_uniffi_fn_func_resolve_schema( + _UniffiConverterTypeLedgerClient.lower(client), + _UniffiConverterString.lower(id)), + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_poll_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_complete_rust_buffer, + _UniffiLib.ffi_indy_besu_vdr_uniffi_rust_future_free_rust_buffer, + # lift function + _UniffiConverterString.lift, + # Error FFI converter + _UniffiConverterTypeVdrError, + ) + +__all__ = [ + "InternalError", + "DidEvents", + "Status", + "TransactionType", + "VdrError", + "ContractConfig", + "ContractSpec", + "DidAttributeChanged", + "DidDelegateChanged", + "DidOwnerChanged", + "DidResolutionOptions", + "EventLog", + "PingStatus", + "QuorumConfig", + "SignatureData", + "TransactionSignature", + "build_add_validator_transaction", + "build_assign_role_transaction", + "build_create_credential_definition_endorsing_data", + "build_create_credential_definition_signed_transaction", + "build_create_credential_definition_transaction", + "build_create_schema_endorsing_data", + "build_create_schema_signed_transaction", + "build_create_schema_transaction", + "build_did_add_delegate_endorsing_data", + "build_did_add_delegate_signed_transaction", + "build_did_add_delegate_transaction", + "build_did_change_owner_endorsing_data", + "build_did_change_owner_signed_transaction", + "build_did_change_owner_transaction", + "build_did_revoke_attribute_endorsing_data", + "build_did_revoke_attribute_signed_transaction", + "build_did_revoke_attribute_transaction", + "build_did_revoke_delegate_endorsing_data", + "build_did_revoke_delegate_signed_transaction", + "build_did_revoke_delegate_transaction", + "build_did_set_attribute_endorsing_data", + "build_did_set_attribute_signed_transaction", + "build_did_set_attribute_transaction", + "build_get_credential_definition_created_transaction", + "build_get_credential_definition_query", + "build_get_did_changed_transaction", + "build_get_did_events_query", + "build_get_did_owner_transaction", + "build_get_identity_nonce_transaction", + "build_get_role_transaction", + "build_get_schema_created_transaction", + "build_get_schema_query", + "build_get_validators_transaction", + "build_has_role_transaction", + "build_remove_validator_transaction", + "build_revoke_role_transaction", + "parse_credential_definition_created_event", + "parse_credential_definition_created_result", + "parse_did_attribute_changed_event_response", + "parse_did_changed_result", + "parse_did_delegate_changed_event_response", + "parse_did_event_response", + "parse_did_owner_changed_event_response", + "parse_did_owner_result", + "parse_get_role_result", + "parse_get_validators_result", + "parse_has_role_result", + "parse_schema_created_event", + "parse_schema_created_result", + "resolve_credential_definition", + "resolve_did", + "resolve_schema", + "EventQuery", + "LedgerClient", + "Transaction", + "TransactionEndorsingData", +] + diff --git a/vdr/wrappers/python/indy2_vdr/version.py b/vdr/wrappers/python/indy_besu_vdr/version.py similarity index 100% rename from vdr/wrappers/python/indy2_vdr/version.py rename to vdr/wrappers/python/indy_besu_vdr/version.py diff --git a/vdr/wrappers/python/setup.py b/vdr/wrappers/python/setup.py index a883aa60..c763f317 100644 --- a/vdr/wrappers/python/setup.py +++ b/vdr/wrappers/python/setup.py @@ -4,7 +4,7 @@ import runpy from setuptools import find_packages, setup -PACKAGE_NAME = "indy2_vdr" +PACKAGE_NAME = "indy_besu_vdr" version_meta = runpy.run_path("./{}/version.py".format(PACKAGE_NAME)) VERSION = version_meta["__version__"] @@ -23,9 +23,9 @@ include_package_data=True, package_data={ "": [ - "indy2_vdr_uniffi.dll", - "libindy2_vdr_uniffi.dylib", - "libindy2_vdr_uniffi.so", + "indy_besu_vdr_uniffi.dll", + "libindy_besu_vdr_uniffi.dylib", + "libindy_besu_vdr_uniffi.so", ] }, python_requires=">=3.6.3",