Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(source-scan): exports, needed for factory build.rs #164

Closed

Conversation

dj8yfo
Copy link
Collaborator

@dj8yfo dj8yfo commented May 14, 2024

tested this against modified near-examples repo/tree/main:
Obtained 3 contracts by deploying :
1st & 2nd:

cd factory
cargo near deploy repro-fct-11.testnet
near contract call-function as-transaction repro-fct-11.testnet create_factory_subaccount_and_deploy json-args '{ "name": "donation-product", "beneficiary": "donatello2.testnet"}' prepaid-gas '300.0 Tgas' attached-deposit '1.7 NEAR' sign-as donatello2.testnet network-config testnet sign-with-keychain send

=>
repro-fct-11.testnet and donation-product.repro-fct-11.testnet
3rd:

cd product-donation
cargo near deploy repro-fct-product-11.testnet

=>
repro-fct-product-11.testnet

2nd and 3rd have identical code hashes and contract source metadata:

 repro-fct-11.testnet - 7eFN2zuvy1DLSQoYV5ksMjzaoXpJw6ppS7f3rtRiF4uz  
 donation-product.repro-fct-11.testnet - CvRsj8e7xSyumyLeKsQjn8r19TAd6WV5ohUw3DzKoM3A 
 repro-fct-product-11.testnet - CvRsj8e7xSyumyLeKsQjn8r19TAd6WV5ohUw3DzKoM3A  

section https://github.com/dj8yfo/factory-rust/blob/main/product-donation/Cargo.toml#L10-L14 was needed to deploy
product-donation subfolder as a standalone contract (to check that metadata is same while cargo near verify is not implemented)


Screenshot_20240522_175228
Screenshot_20240522_175329

@dj8yfo
Copy link
Collaborator Author

dj8yfo commented May 15, 2024

near contract call-function as-read-only repro-fct-11.testnet contract_source_metadata json-args {} network-config testnet now
{
  "build_info": {
    "build_command": [
      "cargo",
      "near",
      "build",
      "--no-default-features",
      "--features",
      "near-sdk/expensive-debug"
    ],
    "build_environment": "dj8yfo/sourcescan:0.x.x-dev-cargo-near-factory-2@sha256:a1341785c2cd7e048f72750b168d6ef1a6c256b7c63034b98f16ba1c178d2ce0",
    "contract_path": "factory",
    "source_code_snapshot": "git+https://github.com/dj8yfo/factory-rust.git?rev=aeb5b4c22cf3a99524d6e549de5caadeb6dff9b0"
  },
  "link": "https://github.com/dj8yfo/factory-rust/tree/aeb5b4c22cf3a99524d6e549de5caadeb6dff9b0",
  "standards": [
    {
      "standard": "nep330",
      "version": "1.2.0"
    }
  ],
  "version": "0.1.0"
}
near contract call-function as-read-only donation-product.repro-fct-11.testnet contract_source_metadata json-args {} network-config testnet now
{
  "build_info": {
    "build_command": [
      "cargo",
      "near",
      "build"
    ],
    "build_environment": "dj8yfo/sourcescan:0.x.x-dev-cargo-near-factory-2@sha256:a1341785c2cd7e048f72750b168d6ef1a6c256b7c63034b98f16ba1c178d2ce0",
    "contract_path": "product-donation",
    "source_code_snapshot": "git+https://github.com/dj8yfo/factory-rust.git?rev=aeb5b4c22cf3a99524d6e549de5caadeb6dff9b0"
  },
  "link": "https://github.com/dj8yfo/factory-rust/tree/aeb5b4c22cf3a99524d6e549de5caadeb6dff9b0",
  "standards": [
    {
      "standard": "nep330",
      "version": "1.2.0"
    }
  ],
  "version": "0.1.0"
}
near contract call-function as-read-only repro-fct-product-11.testnet contract_source_metadata json-args {} network-config testnet now
{
  "build_info": {
    "build_command": [
      "cargo",
      "near",
      "build"
    ],
    "build_environment": "dj8yfo/sourcescan:0.x.x-dev-cargo-near-factory-2@sha256:a1341785c2cd7e048f72750b168d6ef1a6c256b7c63034b98f16ba1c178d2ce0",
    "contract_path": "product-donation",
    "source_code_snapshot": "git+https://github.com/dj8yfo/factory-rust.git?rev=aeb5b4c22cf3a99524d6e549de5caadeb6dff9b0"
  },
  "link": "https://github.com/dj8yfo/factory-rust/tree/aeb5b4c22cf3a99524d6e549de5caadeb6dff9b0",
  "standards": [
    {
      "standard": "nep330",
      "version": "1.2.0"
    }
  ],
  "version": "0.1.0"
}

@dj8yfo dj8yfo marked this pull request as ready for review May 15, 2024 22:36
@dj8yfo dj8yfo marked this pull request as draft May 16, 2024 17:24
@dj8yfo dj8yfo marked this pull request as ready for review May 17, 2024 14:19
@dj8yfo dj8yfo marked this pull request as draft May 20, 2024 09:36
@dj8yfo dj8yfo force-pushed the source-scan-factory-exports branch 2 times, most recently from bdba514 to 210e8e3 Compare May 21, 2024 13:41
@dj8yfo dj8yfo force-pushed the source-scan-factory-exports branch 6 times, most recently from 1eb9f37 to 7d2e11d Compare May 22, 2024 09:53
@dj8yfo dj8yfo marked this pull request as ready for review May 22, 2024 11:29
@dj8yfo dj8yfo force-pushed the source-scan-factory-exports branch from f37a29c to fbed198 Compare May 24, 2024 15:57
@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Jun 6, 2024

closing this as being included in its entirety into #166 and is destined to have the same resolution as #166

@dj8yfo dj8yfo closed this Jun 6, 2024
@dj8yfo dj8yfo changed the title chore(source-scan): exports, needed for factory build.rs feat(source-scan): exports, needed for factory build.rs Jun 7, 2024
frol pushed a commit that referenced this pull request Jun 19, 2024
fast-forward extension of #164 

1.
[Cargo.toml](https://github.com/dj8yfo/sample_no_workspace/blob/1fd39bcbe4d523ac26c3d07c1f49ecc0fc65d9e7/Cargo.toml)
=> `sample-crate-12.testnet`
<details>
  <summary>contract_source_metadata</summary><p>

  ```json
  {
    "build_info": {
      "build_command": [
        "cargo",
        "near",
        "build",
        "--no-default-features",
        "--features",
        "near-sdk/expensive-debug"
      ],
"build_environment":
"dj8yfo/sourcescan:0.x.x-dev-cargo-near-finalization@sha256:f86a095cb3daed21d0b5f86a4b5d9da0c0e26835f85c42678e1d460c9caa2c12",
      "contract_path": "",
"source_code_snapshot":
"git+https://github.com/dj8yfo/sample_no_workspace.git?rev=1fd39bcbe4d523ac26c3d07c1f49ecc0fc65d9e7"
    },
"link":
"https://github.com/dj8yfo/sample_no_workspace/tree/1fd39bcbe4d523ac26c3d07c1f49ecc0fc65d9e7",
    "standards": [
      {
        "standard": "nep330",
        "version": "1.2.0"
      }
    ],
    "version": "0.7.7"
  }    
  ```
  
</p>
</details>

2.
[Cargo.toml](https://github.com/dj8yfo/sample_workspace/blob/86aa6ccf4610f072cd207db86869e6324779780f/self-updates/update/Cargo.toml)
=> `sample-subpath-in-repo-6.testnet`
<details>
  <summary>contract_source_metadata</summary><p>

  ```json
  {
    "build_info": {
      "build_command": [
        "cargo",
        "near",
        "build",
        "--no-release",
        "--no-doc"
      ],
"build_environment":
"dj8yfo/sourcescan:0.x.x-dev-cargo-near-finalization@sha256:f86a095cb3daed21d0b5f86a4b5d9da0c0e26835f85c42678e1d460c9caa2c12",
      "contract_path": "self-updates/update",
"source_code_snapshot":
"git+https://github.com/dj8yfo/sample_workspace.git?rev=86aa6ccf4610f072cd207db86869e6324779780f"
    },
"link":
"https://github.com/dj8yfo/sample_workspace/tree/86aa6ccf4610f072cd207db86869e6324779780f",
    "standards": [
      {
        "standard": "nep330",
        "version": "1.2.0"
      }
    ],
    "version": "1.7.7"
  }
  ```
  
</p>
</details>

3. [dir containing
submodule](https://github.com/dj8yfo/sample_workspace_with_submodules/tree/4b466921b89df67d6e8d1f9956b55a677edb2497/self-updates)
=> `sample-crate-in-submodule-5.testnet`
<details>
  <summary>contract_source_metadata</summary><p>

  ```json
  {
    "build_info": {
      "build_command": [
        "cargo",
        "near",
        "build",
        "--no-release",
        "--no-doc"
      ],
"build_environment":
"dj8yfo/sourcescan:0.x.x-dev-cargo-near-finalization@sha256:f86a095cb3daed21d0b5f86a4b5d9da0c0e26835f85c42678e1d460c9caa2c12",
      "contract_path": "self-updates/update",
"source_code_snapshot":
"git+https://github.com/dj8yfo/sample_workspace_with_submodules.git?rev=4b466921b89df67d6e8d1f9956b55a677edb2497"
    },
"link":
"https://github.com/dj8yfo/sample_workspace_with_submodules/tree/4b466921b89df67d6e8d1f9956b55a677edb2497",
    "standards": [
      {
        "standard": "nep330",
        "version": "1.2.0"
      }
    ],
    "version": "1.0.0"
  }
  ```
  
</p>
</details>

4.
[Cargo.toml](https://bitbucket.org/dj8yfomule/scratch_check_git/src/finalization/Cargo.toml)
=> `bitbucket-scratch-4.testnet`
<details>
  <summary>contract_source_metadata</summary><p>

  ```json
  {
    "build_info": {
      "build_command": [
        "cargo",
        "near",
        "build",
        "--no-release",
        "--no-doc"
      ],
"build_environment":
"dj8yfo/sourcescan:0.x.x-dev-cargo-near-finalization@sha256:f86a095cb3daed21d0b5f86a4b5d9da0c0e26835f85c42678e1d460c9caa2c12",
      "contract_path": "",
"source_code_snapshot":
"git+https://feepdake27@bitbucket.org/dj8yfomule/scratch_check_git.git?rev=af9e835380053205f7fcc9b232a7ebb1c2c20694"
    },
"link":
"https://bitbucket.org/dj8yfomule/scratch_check_git/src/finalization/",
    "standards": [
      {
        "standard": "nep330",
        "version": "1.2.0"
      }
    ],
    "version": "0.1.0"
  }
  ```
  
</p>
</details>

5. factory
[Cargo.toml](https://github.com/dj8yfo/factory-rust/blob/62a34ac86e6323ee6351b20fded7fc668b1e0277/factory/Cargo.toml)
=> `repro-fct-19.testnet`
<details>
  <summary>contract_source_metadata</summary><p>

  ```json
  {
    "build_info": {
      "build_command": [
        "cargo",
        "near",
        "build",
        "--no-default-features",
        "--features",
        "near-sdk/expensive-debug"
      ],
"build_environment":
"dj8yfo/sourcescan:0.x.x-dev-cargo-near-finalization@sha256:f86a095cb3daed21d0b5f86a4b5d9da0c0e26835f85c42678e1d460c9caa2c12",
      "contract_path": "factory",
"source_code_snapshot":
"git+https://github.com/dj8yfo/factory-rust.git?rev=62a34ac86e6323ee6351b20fded7fc668b1e0277"
    },
"link":
"https://github.com/dj8yfo/factory-rust/tree/62a34ac86e6323ee6351b20fded7fc668b1e0277",
    "standards": [
      {
        "standard": "nep330",
        "version": "1.2.0"
      }
    ],
    "version": "0.1.13"
  }
  ```
  
</p>
</details>

6. `repro-fct-19.testnet` => product
`donation-product.repro-fct-19.testnet`
<details>
  <summary>contract_source_metadata</summary><p>

  ```json
  {
    "build_info": {
      "build_command": [
        "cargo",
        "near",
        "build"
      ],
"build_environment":
"dj8yfo/sourcescan:0.x.x-dev-cargo-near-finalization@sha256:f86a095cb3daed21d0b5f86a4b5d9da0c0e26835f85c42678e1d460c9caa2c12",
      "contract_path": "product-donation",
"source_code_snapshot":
"git+https://github.com/dj8yfo/factory-rust.git?rev=62a34ac86e6323ee6351b20fded7fc668b1e0277"
    },
"link":
"https://github.com/dj8yfo/factory-rust/tree/62a34ac86e6323ee6351b20fded7fc668b1e0277",
    "standards": [
      {
        "standard": "nep330",
        "version": "1.2.0"
      }
    ],
    "version": "0.2.9"
  }
  ```
  
</p>
</details>

7. product
[Cargo.toml](https://github.com/dj8yfo/factory-rust/blob/62a34ac86e6323ee6351b20fded7fc668b1e0277/product-donation/Cargo.toml)
=> `repro-fct-product-19.testnet`
<details>
  <summary>contract_source_metadata</summary><p>

  ```json
  {
    "build_info": {
      "build_command": [
        "cargo",
        "near",
        "build"
      ],
"build_environment":
"dj8yfo/sourcescan:0.x.x-dev-cargo-near-finalization@sha256:f86a095cb3daed21d0b5f86a4b5d9da0c0e26835f85c42678e1d460c9caa2c12",
      "contract_path": "product-donation",
"source_code_snapshot":
"git+https://github.com/dj8yfo/factory-rust.git?rev=62a34ac86e6323ee6351b20fded7fc668b1e0277"
    },
"link":
"https://github.com/dj8yfo/factory-rust/tree/62a34ac86e6323ee6351b20fded7fc668b1e0277",
    "standards": [
      {
        "standard": "nep330",
        "version": "1.2.0"
      }
    ],
    "version": "0.2.9"
  }
  ```
  
</p>
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant