@@ -56,10 +56,10 @@ sol! {
5656 #[ derive( Debug , RlpEncodable , RlpDecodable , PartialEq ) ]
5757 struct SubgraphIndexingVoucherMetadata {
5858 uint256 pricePerBlock; // wei GRT
59- bytes32 protocolNetwork ; // eip199:1 format
60- // differentiate based on indexed chain
61- bytes32 chainId ; // eip199:1 format
62- string deployment_ipfs_hash ;
59+ uint256 pricePerEntity ; // wei GRT
60+ string subgraphDeploymentId ; // e.g. "Qmbg1qF4YgHjiVfsVt6a13ddrVcRtWyJQfD4LA3CwHM29f" - TODO consider using bytes32
61+ string protocolNetwork ; // e.g. "eip155:42161"
62+ string chainId ; // e.g. "eip155:1"
6363 }
6464
6565 #[ derive( Debug , RlpEncodable , RlpDecodable , PartialEq ) ]
7777 // data service that will initiate payment collection.
7878 address service;
7979 // signer of the cancellation, can be signed by either party.
80- address cancellled_by ;
80+ address cancelledBy ;
8181 // should only be usable within a limited period of time.
8282 uint64 timestamp;
8383 bytes metadata;
@@ -197,7 +197,7 @@ impl SignedCancellationRequest {
197197 . recover_address_from_prehash ( & self . request . eip712_signing_hash ( domain) )
198198 . map_err ( |err| DipsError :: InvalidSignature ( err. to_string ( ) ) ) ?;
199199
200- if signer. ne ( & self . request . cancellled_by ) {
200+ if signer. ne ( & self . request . cancelledBy ) {
201201 return Err ( DipsError :: UnexpectedSigner ) ;
202202 }
203203
@@ -291,9 +291,10 @@ mod test {
291291
292292 let metadata = SubgraphIndexingVoucherMetadata {
293293 pricePerBlock : U256 :: from ( 10000_u64 ) ,
294- protocolNetwork : FixedBytes :: left_padding_from ( "arbitrum-one" . as_bytes ( ) ) ,
295- chainId : FixedBytes :: left_padding_from ( "mainnet" . as_bytes ( ) ) ,
296- deployment_ipfs_hash : deployment_id,
294+ pricePerEntity : U256 :: from ( 100_u64 ) ,
295+ protocolNetwork : "eip155:42161" ,
296+ chainId : "eip155:1" ,
297+ subgraphDeploymentId : deployment_id,
297298 } ;
298299
299300 let voucher = IndexingAgreementVoucher {
@@ -343,9 +344,10 @@ mod test {
343344
344345 let metadata = SubgraphIndexingVoucherMetadata {
345346 pricePerBlock : U256 :: from ( 10000_u64 ) ,
346- protocolNetwork : FixedBytes :: left_padding_from ( "arbitrum-one" . as_bytes ( ) ) ,
347- chainId : FixedBytes :: left_padding_from ( "mainnet" . as_bytes ( ) ) ,
348- deployment_ipfs_hash : deployment_id,
347+ pricePerEntity : U256 :: from ( 100_u64 ) ,
348+ protocolNetwork : "eip155:42161" ,
349+ chainId : "eip155:1" ,
350+ subgraphDeploymentId : deployment_id,
349351 } ;
350352
351353 let voucher = IndexingAgreementVoucher {
@@ -384,9 +386,10 @@ mod test {
384386
385387 let metadata = SubgraphIndexingVoucherMetadata {
386388 pricePerBlock : U256 :: from ( 10000_u64 ) ,
387- protocolNetwork : FixedBytes :: left_padding_from ( "arbitrum-one" . as_bytes ( ) ) ,
388- chainId : FixedBytes :: left_padding_from ( "mainnet" . as_bytes ( ) ) ,
389- deployment_ipfs_hash : deployment_id,
389+ pricePerEntity : U256 :: from ( 100_u64 ) ,
390+ protocolNetwork : "eip155:42161" ,
391+ chainId : "eip155:1" ,
392+ subgraphDeploymentId : deployment_id,
390393 } ;
391394
392395 let voucher = IndexingAgreementVoucher {
@@ -428,9 +431,10 @@ mod test {
428431
429432 let metadata = SubgraphIndexingVoucherMetadata {
430433 pricePerBlock : U256 :: from ( 10000_u64 ) ,
431- protocolNetwork : FixedBytes :: left_padding_from ( "arbitrum-one" . as_bytes ( ) ) ,
432- chainId : FixedBytes :: left_padding_from ( "mainnet" . as_bytes ( ) ) ,
433- deployment_ipfs_hash : deployment_id,
434+ pricePerEntity : U256 :: from ( 100_u64 ) ,
435+ protocolNetwork : "eip155:42161" ,
436+ chainId : "eip155:1" ,
437+ subgraphDeploymentId : deployment_id,
434438 } ;
435439
436440 struct Case < ' a > {
@@ -479,7 +483,7 @@ mod test {
479483 payee : payee_addr,
480484 service : Address ( FixedBytes :: ZERO ) ,
481485 metadata : metadata. eip712_hash_struct ( ) . to_owned ( ) . into ( ) ,
482- cancellled_by : signer. address ( ) ,
486+ cancelledBy : signer. address ( ) ,
483487 timestamp,
484488 } ;
485489 let domain = eip712_domain ( 0 , Address :: ZERO ) ;
0 commit comments