From c10b73975c3f8a9c2fd350c71f684d860ac5880a Mon Sep 17 00:00:00 2001 From: Tupui <23188539+tupui@users.noreply.github.com> Date: Wed, 18 Sep 2024 22:36:13 +0200 Subject: [PATCH] Linter and main/master on GH --- .../soroban_versioning/dist/index.d.ts | 16 ++-- .../packages/soroban_versioning/dist/index.js | 96 +++++++++---------- dapp/packages/soroban_versioning/src/index.ts | 26 ++--- dapp/src/utils/editLinkFunctions.ts | 3 +- 4 files changed, 71 insertions(+), 70 deletions(-) diff --git a/dapp/packages/soroban_versioning/dist/index.d.ts b/dapp/packages/soroban_versioning/dist/index.d.ts index f8f7543..e13ad9a 100644 --- a/dapp/packages/soroban_versioning/dist/index.d.ts +++ b/dapp/packages/soroban_versioning/dist/index.d.ts @@ -1,11 +1,11 @@ /// -import {Buffer} from "buffer"; +import { Buffer } from "buffer"; import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, } from "@stellar/stellar-sdk/contract"; -import type {u32} from "@stellar/stellar-sdk/contract"; +import type { u32 } from "@stellar/stellar-sdk/contract"; export * from "@stellar/stellar-sdk"; export * as contract from "@stellar/stellar-sdk/contract"; @@ -45,13 +45,13 @@ export type DataKey = { }; export type ProjectKey = | { - tag: "Key"; - values: readonly [Buffer]; -} + tag: "Key"; + values: readonly [Buffer]; + } | { - tag: "LastHash"; - values: readonly [Buffer]; -}; + tag: "LastHash"; + values: readonly [Buffer]; + }; export interface Config { hash: string; diff --git a/dapp/packages/soroban_versioning/dist/index.js b/dapp/packages/soroban_versioning/dist/index.js index b62f383..5db28c1 100644 --- a/dapp/packages/soroban_versioning/dist/index.js +++ b/dapp/packages/soroban_versioning/dist/index.js @@ -1,65 +1,65 @@ -import {Buffer} from "buffer"; +import { Buffer } from "buffer"; import { - Client as ContractClient, - Spec as ContractSpec, + Client as ContractClient, + Spec as ContractSpec, } from "@stellar/stellar-sdk/contract"; export * from "@stellar/stellar-sdk"; export * as contract from "@stellar/stellar-sdk/contract"; export * as rpc from "@stellar/stellar-sdk/rpc"; if (typeof window !== "undefined") { - //@ts-ignore Buffer exists - window.Buffer = window.Buffer || Buffer; + //@ts-ignore Buffer exists + window.Buffer = window.Buffer || Buffer; } export const networks = { - testnet: { - networkPassphrase: "Test SDF Network ; September 2015", - contractId: "CCYM5OC6RTMEUHRK2BRU5YX4G4O745DPLPU4EXVTRCUN7JRJJWXEEXAB", - }, + testnet: { + networkPassphrase: "Test SDF Network ; September 2015", + contractId: "CCYM5OC6RTMEUHRK2BRU5YX4G4O745DPLPU4EXVTRCUN7JRJJWXEEXAB", + }, }; export const Errors = { - 0: {message: "UnexpectedError"}, - 1: {message: "InvalidKey"}, - 2: {message: "ProjectAlreadyExist"}, - 3: {message: "UnregisteredMaintainer"}, - 4: {message: "NoHashFound"}, - 5: {message: "InvalidDomainError"}, - 6: {message: "MaintainerNotDomainOwner"}, + 0: { message: "UnexpectedError" }, + 1: { message: "InvalidKey" }, + 2: { message: "ProjectAlreadyExist" }, + 3: { message: "UnregisteredMaintainer" }, + 4: { message: "NoHashFound" }, + 5: { message: "InvalidDomainError" }, + 6: { message: "MaintainerNotDomainOwner" }, }; export class Client extends ContractClient { - options; + options; - constructor(options) { - super( - new ContractSpec([ - "AAAABAAAAAAAAAAAAAAADkNvbnRyYWN0RXJyb3JzAAAAAAAHAAAAAAAAAA9VbmV4cGVjdGVkRXJyb3IAAAAAAAAAAAAAAAAKSW52YWxpZEtleQAAAAAAAQAAAAAAAAATUHJvamVjdEFscmVhZHlFeGlzdAAAAAACAAAAAAAAABZVbnJlZ2lzdGVyZWRNYWludGFpbmVyAAAAAAADAAAAAAAAAAtOb0hhc2hGb3VuZAAAAAAEAAAAAAAAABJJbnZhbGlkRG9tYWluRXJyb3IAAAAAAAUAAAAAAAAAGE1haW50YWluZXJOb3REb21haW5Pd25lcgAAAAY=", - "AAAAAgAAAAAAAAAAAAAAB0RhdGFLZXkAAAAAAQAAAAAAAAAAAAAABUFkbWluAAAA", - "AAAAAgAAAAAAAAAAAAAAClByb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bWl0IGhhc2gAAAAGY29tbWl0AAAAAAADAAAAAAAAAAptYWludGFpbmVyAAAAAAATAAAAAAAAAAtwcm9qZWN0X2tleQAAAAAOAAAAAAAAAARoYXNoAAAAEAAAAAA=", - "AAAAAAAAABhHZXQgdGhlIGxhc3QgY29tbWl0IGhhc2gAAAAKZ2V0X2NvbW1pdAAAAAAAAQAAAAAAAAALcHJvamVjdF9rZXkAAAAADgAAAAEAAAAQ", - "AAAAAAAAAAAAAAALZ2V0X3Byb2plY3QAAAAAAQAAAAAAAAALcHJvamVjdF9rZXkAAAAADgAAAAEAAAfQAAAAB1Byb2plY3QA", - ]), - options, - ); - this.options = options; - } + constructor(options) { + super( + new ContractSpec([ + "AAAABAAAAAAAAAAAAAAADkNvbnRyYWN0RXJyb3JzAAAAAAAHAAAAAAAAAA9VbmV4cGVjdGVkRXJyb3IAAAAAAAAAAAAAAAAKSW52YWxpZEtleQAAAAAAAQAAAAAAAAATUHJvamVjdEFscmVhZHlFeGlzdAAAAAACAAAAAAAAABZVbnJlZ2lzdGVyZWRNYWludGFpbmVyAAAAAAADAAAAAAAAAAtOb0hhc2hGb3VuZAAAAAAEAAAAAAAAABJJbnZhbGlkRG9tYWluRXJyb3IAAAAAAAUAAAAAAAAAGE1haW50YWluZXJOb3REb21haW5Pd25lcgAAAAY=", + "AAAAAgAAAAAAAAAAAAAAB0RhdGFLZXkAAAAAAQAAAAAAAAAAAAAABUFkbWluAAAA", + "AAAAAgAAAAAAAAAAAAAAClByb2plY3RLZXkAAAAAAAIAAAABAAAAAAAAAANLZXkAAAAAAQAAAA4AAAABAAAAAAAAAAhMYXN0SGFzaAAAAAEAAAAO", + "AAAAAQAAAAAAAAAAAAAABkNvbmZpZwAAAAAAAgAAAAAAAAAEaGFzaAAAABAAAAAAAAAAA3VybAAAAAAQ", + "AAAAAQAAAAAAAAAAAAAAB1Byb2plY3QAAAAAAwAAAAAAAAAGY29uZmlnAAAAAAfQAAAABkNvbmZpZwAAAAAAAAAAAAtt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b2plY3QAAAAAAQAAAAAAAAALcHJvamVjdF9rZXkAAAAADgAAAAEAAAfQAAAAB1Byb2plY3QA", + ]), + options, + ); + this.options = options; + } - fromJSON = { - init: this.txFromJSON, - version: this.txFromJSON, - upgrade: this.txFromJSON, - register: this.txFromJSON, - update_config: this.txFromJSON, - commit: this.txFromJSON, - get_commit: this.txFromJSON, - get_project: this.txFromJSON, - }; + fromJSON = { + init: this.txFromJSON, + version: this.txFromJSON, + upgrade: this.txFromJSON, + register: this.txFromJSON, + update_config: this.txFromJSON, + commit: this.txFromJSON, + get_commit: this.txFromJSON, + get_project: this.txFromJSON, + }; } diff --git a/dapp/packages/soroban_versioning/src/index.ts b/dapp/packages/soroban_versioning/src/index.ts index 6ccc98f..30229c5 100644 --- a/dapp/packages/soroban_versioning/src/index.ts +++ b/dapp/packages/soroban_versioning/src/index.ts @@ -1,5 +1,5 @@ -import {Buffer} from "buffer"; -import {Address} from "@stellar/stellar-sdk"; +import { Buffer } from "buffer"; +import { Address } from "@stellar/stellar-sdk"; import { AssembledTransaction, Client as ContractClient, @@ -38,19 +38,19 @@ export const networks = { } as const; export const Errors = { - 0: {message: "UnexpectedError"}, + 0: { message: "UnexpectedError" }, - 1: {message: "InvalidKey"}, + 1: { message: "InvalidKey" }, - 2: {message: "ProjectAlreadyExist"}, + 2: { message: "ProjectAlreadyExist" }, - 3: {message: "UnregisteredMaintainer"}, + 3: { message: "UnregisteredMaintainer" }, - 4: {message: "NoHashFound"}, + 4: { message: "NoHashFound" }, - 5: {message: "InvalidDomainError"}, + 5: { message: "InvalidDomainError" }, - 6: {message: "MaintainerNotDomainOwner"}, + 6: { message: "MaintainerNotDomainOwner" }, }; export type DataKey = { tag: "Admin"; values: void }; @@ -74,7 +74,7 @@ export interface Client { * Construct and simulate a init transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ init: ( - {admin}: { admin: string }, + { admin }: { admin: string }, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE @@ -117,7 +117,7 @@ export interface Client { * Construct and simulate a upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ upgrade: ( - {new_wasm_hash}: { new_wasm_hash: Buffer }, + { new_wasm_hash }: { new_wasm_hash: Buffer }, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE @@ -243,7 +243,7 @@ export interface Client { * Get the last commit hash */ get_commit: ( - {project_key}: { project_key: Buffer }, + { project_key }: { project_key: Buffer }, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE @@ -266,7 +266,7 @@ export interface Client { * Construct and simulate a get_project transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object. */ get_project: ( - {project_key}: { project_key: Buffer }, + { project_key }: { project_key: Buffer }, options?: { /** * The fee to pay for the transaction. Default: BASE_FEE diff --git a/dapp/src/utils/editLinkFunctions.ts b/dapp/src/utils/editLinkFunctions.ts index 7a365ad..eb33a2e 100644 --- a/dapp/src/utils/editLinkFunctions.ts +++ b/dapp/src/utils/editLinkFunctions.ts @@ -43,7 +43,8 @@ export function getGithubContentUrlFromConfigUrl( ): string | undefined { const { username, repoName } = getAuthorRepo(configUrl); if (username && repoName) { - return getGithubContentUrl(username, repoName, "main/tansu.toml"); + // use master as GitHub will do an automatic redirection to main + return getGithubContentUrl(username, repoName, "master/tansu.toml"); } return undefined; }