Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e20be4a2c0 | ||
|
|
d8a54c5eec |
@@ -33,4 +33,5 @@ jobs:
|
||||
config: baseUrl=${{ github.event.inputs.url }}
|
||||
env: grepTags=@live
|
||||
env:
|
||||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
######
|
||||
|
||||
- name: Run Cypress tests
|
||||
run: yarn nx run ${{ matrix.project }}:e2e ${{ env.SKIP_CACHE }} --browser chrome --env.grepTags="${{ inputs.tags }}"
|
||||
run: yarn nx run ${{ matrix.project }}:e2e ${{ env.SKIP_CACHE }} --record --key ${{ secrets.CYPRESS_RECORD_KEY }} --browser chrome --env.grepTags="${{ inputs.tags }}"
|
||||
working-directory: frontend-monorepo
|
||||
env:
|
||||
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
|
||||
|
||||
@@ -180,45 +180,13 @@ jobs:
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
run: |
|
||||
# display info about app
|
||||
curl -H "Authorization: ${{ secrets.FLEEK_API_KEY }}" \
|
||||
curl -H "Authorization: $FLEEK_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"query": "query{getSiteById(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id latestDeploy{id status}}}"}' \
|
||||
https://api.fleek.co/graphql
|
||||
|
||||
# trigger new deployment as base image is always set to vegaprotocol/trading:mainnet
|
||||
curl -H "Authorization: ${{ secrets.FLEEK_API_KEY }}" \
|
||||
curl -H "Authorization: $FLEEK_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"query": "mutation{triggerDeploy(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id status}}"}' \
|
||||
https://api.fleek.co/graphql
|
||||
|
||||
- name: Checkout vega.xyz
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: vegaprotocol/vega.xyz
|
||||
path: './vega-xyz'
|
||||
token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: Update hash on interstitial page
|
||||
if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
|
||||
run: |
|
||||
curl -L https://dist.ipfs.tech/kubo/v0.20.0/kubo_v0.20.0_linux-amd64.tar.gz -o kubo.tgz
|
||||
tar -xzf kubo.tgz
|
||||
export PATH="$PATH:$PWD/kubo"
|
||||
which ipfs
|
||||
new_hash=$(cat ${{ matrix.app }}-ipfs-hash)
|
||||
cd vega-xyz
|
||||
./interstital-allow-update.sh ${new_hash}
|
||||
git config --global user.email "vega-ci-bot@vega.xyz"
|
||||
git config --global user.name "vega-ci-bot"
|
||||
branch_name=${{ github.ref_name }}-hash-update
|
||||
git checkout -b "${branch_name}"
|
||||
git add interstitial-allow.json netlify.toml
|
||||
commit_msg="feat(ci): Update CID for console release @ ${{ github.ref }}"
|
||||
git commit -m "${commit_msg}"
|
||||
git push -u origin "${branch_name}"
|
||||
pr_url="$(gh pr create --title "${commit_msg}" --body 'update ipfs hash for console @ ${{ github.ref }}')"
|
||||
echo $pr_url
|
||||
gh pr merge --auto $pr_url
|
||||
|
||||
@@ -57,6 +57,7 @@ context(
|
||||
// 2001-STKE-002, 2001-STKE-032
|
||||
before('visit staking tab and connect vega wallet', function () {
|
||||
cy.visit('/');
|
||||
cy.validatorsSelfDelegate();
|
||||
ethereumWalletConnect();
|
||||
// this is a workaround for #2422 which can be removed once issue is resolved
|
||||
cy.associateTokensToVegaWallet('4');
|
||||
|
||||
@@ -109,7 +109,7 @@ context(
|
||||
);
|
||||
cy.getByTestId('protocol-upgrade-proposal-status').should(
|
||||
'have.text',
|
||||
'Approved by validators '
|
||||
'Approved '
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -136,7 +136,7 @@ context(
|
||||
);
|
||||
cy.getByTestId('protocol-upgrade-state').should(
|
||||
'have.text',
|
||||
'Approved by validators'
|
||||
'Approved'
|
||||
);
|
||||
cy.getByTestId('protocol-upgrade-release-tag').should(
|
||||
'have.text',
|
||||
|
||||
@@ -31,6 +31,9 @@ const totalPenaltyToolTip = '[data-testid="total-penalty-tooltip"]';
|
||||
const epochCountDown = '[data-testid="epoch-countdown"]';
|
||||
const stakeNumberRegex = /^\d{1,3}(,\d{3})*(\.\d+)?$/;
|
||||
|
||||
// If running locally, validators need to have self-stake to be displayed
|
||||
// Run cy.validatorsSelfDelegate() in before hook
|
||||
|
||||
context('Validators Page - verify elements on page', function () {
|
||||
before('navigate to validators page', function () {
|
||||
cy.visit('/validators');
|
||||
|
||||
@@ -33,6 +33,4 @@ before(() => {
|
||||
aliasGQLQuery(req, 'ChainId', chainIdQuery());
|
||||
aliasGQLQuery(req, 'Statistics', statisticsQuery());
|
||||
});
|
||||
// Self stake validators so they are displayed
|
||||
cy.validatorsSelfDelegate();
|
||||
});
|
||||
|
||||
@@ -788,9 +788,9 @@
|
||||
"homeVegaTokenButtonText": "Manage tokens",
|
||||
"downloadProposalJson": "Download proposal as JSON",
|
||||
"networkUpgrade": "Network Upgrade",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_APPROVED": "Approved by validators",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_PENDING": "Waiting for validator votes",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_REJECTED": "Declined by validators",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_APPROVED": "Approved",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_PENDING": "Pending",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_REJECTED": "Rejected",
|
||||
"PROTOCOL_UPGRADE_PROPOSAL_STATUS_UNSPECIFIED": "Unspecified",
|
||||
"vegaRelease{release}": "Vega Release {{release}}",
|
||||
"upgradeBlockHeight": "Upgrade block height",
|
||||
|
||||
+1
-3
@@ -32,9 +32,7 @@ describe('ProtocolUpgradeProposalDetailInfo', () => {
|
||||
|
||||
it('should render the state', () => {
|
||||
const { getByTestId } = renderComponent();
|
||||
expect(getByTestId('protocol-upgrade-state')).toHaveTextContent(
|
||||
'Waiting for validator votes'
|
||||
);
|
||||
expect(getByTestId('protocol-upgrade-state')).toHaveTextContent('Pending');
|
||||
});
|
||||
|
||||
it('should render the vega release tag', () => {
|
||||
|
||||
+1
-7
@@ -26,34 +26,28 @@ describe('ProtocolUpgradeProposalsListItem', () => {
|
||||
status:
|
||||
ProtocolUpgradeProposalStatus.PROTOCOL_UPGRADE_PROPOSAL_STATUS_REJECTED,
|
||||
icon: 'protocol-upgrade-proposal-status-icon-rejected',
|
||||
text: 'Declined by validators',
|
||||
},
|
||||
{
|
||||
status:
|
||||
ProtocolUpgradeProposalStatus.PROTOCOL_UPGRADE_PROPOSAL_STATUS_PENDING,
|
||||
icon: 'protocol-upgrade-proposal-status-icon-pending',
|
||||
text: 'Waiting for validator votes',
|
||||
},
|
||||
{
|
||||
status:
|
||||
ProtocolUpgradeProposalStatus.PROTOCOL_UPGRADE_PROPOSAL_STATUS_APPROVED,
|
||||
icon: 'protocol-upgrade-proposal-status-icon-approved',
|
||||
text: 'Approved by validators',
|
||||
},
|
||||
{
|
||||
status:
|
||||
ProtocolUpgradeProposalStatus.PROTOCOL_UPGRADE_PROPOSAL_STATUS_UNSPECIFIED,
|
||||
icon: 'protocol-upgrade-proposal-status-icon-unspecified',
|
||||
text: 'Unspecified',
|
||||
},
|
||||
];
|
||||
|
||||
statuses.forEach(({ status, icon, text }) => {
|
||||
statuses.forEach(({ status, icon }) => {
|
||||
renderComponent({ ...proposal, status });
|
||||
const statusIcon = screen.getByTestId(icon);
|
||||
const textContent = screen.getByText(text);
|
||||
expect(statusIcon).toBeInTheDocument();
|
||||
expect(textContent).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,37 +1,4 @@
|
||||
[
|
||||
{
|
||||
"tranche_id": 59,
|
||||
"tranche_start": "2024-05-01T00:00:00.000Z",
|
||||
"tranche_end": "2024-11-01T00:00:00.000Z",
|
||||
"total_added": "15000",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "15000",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15000",
|
||||
"user": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
"tx": "0x90af73d7321833fc32445850655a1210f0298845b9222e695e1229801f7a95b0"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"users": [
|
||||
{
|
||||
"address": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15000",
|
||||
"user": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
"tranche_id": 59,
|
||||
"tx": "0x90af73d7321833fc32445850655a1210f0298845b9222e695e1229801f7a95b0"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "15000",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "15000"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tranche_id": 58,
|
||||
"tranche_start": "2023-05-11T00:00:00.000Z",
|
||||
@@ -81,8 +48,8 @@
|
||||
"tranche_start": "2023-04-20T00:00:00.000Z",
|
||||
"tranche_end": "2023-05-20T00:00:00.000Z",
|
||||
"total_added": "19242.125",
|
||||
"total_removed": "2249.511113406525",
|
||||
"locked_amount": "4805.928581211419705575",
|
||||
"total_removed": "1979.64045368475",
|
||||
"locked_amount": "5448.4017548225310304875",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "188",
|
||||
@@ -271,11 +238,6 @@
|
||||
"user": "0xDd7a98557586ce21f770662319C2047C5a3bD605",
|
||||
"tx": "0x47f5bf2c758c5270dd1b6519ac649ddabef8199f8a0bae319e36f8ac5c9c142e"
|
||||
},
|
||||
{
|
||||
"amount": "269.870659721775",
|
||||
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
|
||||
"tx": "0x156ef84c345adecdf7b1c55756b1f4326716d1b0191ce1a208f614fc807ce033"
|
||||
},
|
||||
{
|
||||
"amount": "202.093666077975",
|
||||
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
|
||||
@@ -349,12 +311,6 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "269.870659721775",
|
||||
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
|
||||
"tranche_id": 56,
|
||||
"tx": "0x156ef84c345adecdf7b1c55756b1f4326716d1b0191ce1a208f614fc807ce033"
|
||||
},
|
||||
{
|
||||
"amount": "202.093666077975",
|
||||
"user": "0x1447Efc62d5077d7AbB20492dF831Dd6c9Eb1756",
|
||||
@@ -381,8 +337,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "1207.5",
|
||||
"withdrawn_tokens": "866.872728582",
|
||||
"remaining_tokens": "340.627271418"
|
||||
"withdrawn_tokens": "597.002068860225",
|
||||
"remaining_tokens": "610.497931139775"
|
||||
},
|
||||
{
|
||||
"address": "0x33Ce1D9E53AFb7367E34749517C086405a651a95",
|
||||
@@ -1904,7 +1860,7 @@
|
||||
"tranche_start": "2023-03-06T00:00:00.000Z",
|
||||
"tranche_end": "2023-04-06T00:00:00.000Z",
|
||||
"total_added": "14099",
|
||||
"total_removed": "4343.49002352036",
|
||||
"total_removed": "3785.49002352036",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -2674,11 +2630,6 @@
|
||||
"user": "0x2a65Ae527C6Ff4665e048B0E0883c486A7BA4DBc",
|
||||
"tx": "0xb0edcc25e422bc3db3ad8027dfdfc0928abd7a8af8957a1699e4cf2dc8cee8f7"
|
||||
},
|
||||
{
|
||||
"amount": "558",
|
||||
"user": "0xA7f89FF809549F4577993de3d1B3017241a53F40",
|
||||
"tx": "0x84e5ff587c312b578fa946e2dce386cdf19c7638602b12eceaaab7de563f8394"
|
||||
},
|
||||
{
|
||||
"amount": "30",
|
||||
"user": "0xBe9F912Ad481C61B653463E8F1D2b2b310D49861",
|
||||
@@ -4495,17 +4446,10 @@
|
||||
"tx": "0x46d80a145d2f49ef3152cbfaa6d2bb054deabe21396ab43553a3f076e2db62e1"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "558",
|
||||
"user": "0xA7f89FF809549F4577993de3d1B3017241a53F40",
|
||||
"tranche_id": 53,
|
||||
"tx": "0x84e5ff587c312b578fa946e2dce386cdf19c7638602b12eceaaab7de563f8394"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "558",
|
||||
"withdrawn_tokens": "558",
|
||||
"remaining_tokens": "0"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "558"
|
||||
},
|
||||
{
|
||||
"address": "0x363D3d06d70761c34D6EfEB25E409A9549E6970D",
|
||||
@@ -4963,7 +4907,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "86666.297",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "49030.0504645820725222068",
|
||||
"locked_amount": "49267.8881106870934141481",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "86666.297",
|
||||
@@ -5029,7 +4973,7 @@
|
||||
"tranche_end": "2023-06-01T00:00:00.000Z",
|
||||
"total_added": "2500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "267.758572446072375",
|
||||
"locked_amount": "281.5177299552299",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2500",
|
||||
@@ -5062,7 +5006,7 @@
|
||||
"tranche_end": "2023-11-01T00:00:00.000Z",
|
||||
"total_added": "15000.000000000000015",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "14061.9150060386475140619150060386475",
|
||||
"locked_amount": "14143.5726147343005141435726147343005",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1.5e-14",
|
||||
@@ -5104,15 +5048,10 @@
|
||||
"tranche_id": 46,
|
||||
"tranche_start": "2023-11-01T00:00:00.000Z",
|
||||
"tranche_end": "2024-05-01T00:00:00.000Z",
|
||||
"total_added": "22500",
|
||||
"total_added": "7500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "22500",
|
||||
"locked_amount": "7500",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15000",
|
||||
"user": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
|
||||
"tx": "0x959f5eed214f5376e834c2c20ed2a23a75c4465240c2776452ade80afa11ae2e"
|
||||
},
|
||||
{
|
||||
"amount": "7500",
|
||||
"user": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
@@ -5121,21 +5060,6 @@
|
||||
],
|
||||
"withdrawals": [],
|
||||
"users": [
|
||||
{
|
||||
"address": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "15000",
|
||||
"user": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
|
||||
"tranche_id": 46,
|
||||
"tx": "0x959f5eed214f5376e834c2c20ed2a23a75c4465240c2776452ade80afa11ae2e"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "15000",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "15000"
|
||||
},
|
||||
{
|
||||
"address": "0xA530ac2B576eF27C09B7b55C83b3E163D167e9AE",
|
||||
"deposits": [
|
||||
@@ -5170,7 +5094,7 @@
|
||||
"tranche_end": "2023-09-01T00:00:00.000Z",
|
||||
"total_added": "17500",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "10603.93707226247975",
|
||||
"locked_amount": "10699.20428240740825",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "12500",
|
||||
@@ -5437,7 +5361,7 @@
|
||||
"tranche_end": "2023-08-01T00:00:00.000Z",
|
||||
"total_added": "37500",
|
||||
"total_removed": "18302.01762945",
|
||||
"locked_amount": "16676.690070595455",
|
||||
"locked_amount": "16884.2176949048475",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "7500",
|
||||
@@ -5867,7 +5791,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "129999.45",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "48985.316712730632200127",
|
||||
"locked_amount": "49222.937361909470971875",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129999.45",
|
||||
@@ -5900,7 +5824,7 @@
|
||||
"tranche_end": "2024-04-01T00:00:00.000Z",
|
||||
"total_added": "54144.7663",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "48004.33914075889629566061",
|
||||
"locked_amount": "48152.52222157082703945313",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "54144.7663",
|
||||
@@ -5933,7 +5857,7 @@
|
||||
"tranche_end": "2023-09-03T00:00:00.000Z",
|
||||
"total_added": "62600",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "19464.79667681379966",
|
||||
"locked_amount": "19636.5893708777252",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "10000",
|
||||
@@ -6126,7 +6050,7 @@
|
||||
"tranche_end": "2023-09-17T00:00:00.000Z",
|
||||
"total_added": "5000",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "1746.4770421106035",
|
||||
"locked_amount": "1760.1985032978185",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "5000",
|
||||
@@ -7195,7 +7119,7 @@
|
||||
"tranche_end": "2023-06-02T00:00:00.000Z",
|
||||
"total_added": "1939928.38",
|
||||
"total_removed": "1709370.7872515768348",
|
||||
"locked_amount": "108916.74248669465746918748",
|
||||
"locked_amount": "114240.47288112379901012188",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1852091.69",
|
||||
@@ -41067,7 +40991,7 @@
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "3732368.4671",
|
||||
"total_removed": "715655.108029600523393",
|
||||
"locked_amount": "191868.437149237997353062585",
|
||||
"locked_amount": "200049.157239417195653993231",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1998.95815",
|
||||
@@ -42459,8 +42383,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "15870102.715470999700000001",
|
||||
"total_removed": "875570.57907812695176852",
|
||||
"locked_amount": "5980040.74464094540876136852099906476290886",
|
||||
"total_removed": "873375.18460711694221852",
|
||||
"locked_amount": "6009049.0528282882857238651980333316436875",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "16249.93",
|
||||
@@ -42979,11 +42903,6 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x989d22d5ba66353cb132b5643100a99e78133e5d40aef1ac91ed6ab0a2290299"
|
||||
},
|
||||
{
|
||||
"amount": "2195.39447101000955",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tx": "0xa515dafd399b366ba7f510ea6314587eb19e83fa92dbd5c2a212f3541a0cc4ef"
|
||||
},
|
||||
{
|
||||
"amount": "10150.87581603206683",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
@@ -46954,12 +46873,6 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "2195.39447101000955",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xa515dafd399b366ba7f510ea6314587eb19e83fa92dbd5c2a212f3541a0cc4ef"
|
||||
},
|
||||
{
|
||||
"amount": "10150.87581603206683",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
@@ -47250,8 +47163,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "150551.801",
|
||||
"withdrawn_tokens": "93772.59940382165655",
|
||||
"remaining_tokens": "56779.20159617834345"
|
||||
"withdrawn_tokens": "91577.204932811647",
|
||||
"remaining_tokens": "58974.596067188353"
|
||||
},
|
||||
{
|
||||
"address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148",
|
||||
@@ -59257,8 +59170,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "472355.6199999996",
|
||||
"total_removed": "44730.9909821383416",
|
||||
"locked_amount": "30402.650633041581093917170877724",
|
||||
"total_removed": "44544.1737890903416",
|
||||
"locked_amount": "31698.932494320098793185875900572",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "3000",
|
||||
@@ -65887,11 +65800,6 @@
|
||||
"user": "0x3F9E884B459a6AaC3f66b72555611AdE68a7F472",
|
||||
"tx": "0x4697229c7f272bd3fc06ecdc1b15143d28e20083e15f1b3cadb3fc80e80af180"
|
||||
},
|
||||
{
|
||||
"amount": "186.817193048",
|
||||
"user": "0x0003423D0A1858B6Eaf9a67914aBc67cDF989c2F",
|
||||
"tx": "0x7f120bd664d54bdabddad1ddb7ffdd84fbaa2630f1657289e3a7b11503ec4018"
|
||||
},
|
||||
{
|
||||
"amount": "182.662252664",
|
||||
"user": "0xb1169C6daAc76bAcaf0D8f87641Fc38fbabe569F",
|
||||
@@ -71147,17 +71055,10 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "186.817193048",
|
||||
"user": "0x0003423D0A1858B6Eaf9a67914aBc67cDF989c2F",
|
||||
"tranche_id": 5,
|
||||
"tx": "0x7f120bd664d54bdabddad1ddb7ffdd84fbaa2630f1657289e3a7b11503ec4018"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "200",
|
||||
"withdrawn_tokens": "186.817193048",
|
||||
"remaining_tokens": "13.182806952"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "200"
|
||||
},
|
||||
{
|
||||
"address": "0x659ce8E49DA0c872AAC44c70496122044CbcA911",
|
||||
@@ -89070,7 +88971,7 @@
|
||||
"tranche_start": "2021-12-05T00:00:00.000Z",
|
||||
"tranche_end": "2022-06-05T00:00:00.000Z",
|
||||
"total_added": "171288.42",
|
||||
"total_removed": "71890.5995794947989",
|
||||
"total_removed": "70140.5995794947989",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -93295,41 +93196,6 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xcAEbd70D80D5aB92Ae5A2E1c92F479298826548C",
|
||||
"tx": "0x7ffbc82e96bb7c796feb548a7ca48a7430a47dae3f2e9de859e6d45ac31a4e6c"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xac494D6eC2CcA7C9BD1caD0c1D0516F3706c6b7c",
|
||||
"tx": "0x85a5d2a4faa6490fc25e080f09dc4d9b5fb3857d762042ba2dcbc0f04de41e0c"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x4eE1C5ED78143f298ae4E5E17e538a99E8512db7",
|
||||
"tx": "0xcb7b99dc5240cdcaaed2fae06e9fd8172db0387179fe09b5f1e1cefff16c6025"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x01E41ffFBcBC9DDA6E2e9e7291cA8AcCE1AF2091",
|
||||
"tx": "0x0af2b3703c268eed4532409b52b6fae066207adf80f9dd2fc17b7aacc40f2879"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xa9C1CA1E66CB3063352433843521861844A2Fd33",
|
||||
"tx": "0x8fad99b8976fff57a099e59351ae96379ec3041e32ccce144727eea29cfffe59"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x13A01db15250975cE4f7AddF5C20CC1f5056Fc47",
|
||||
"tx": "0xc4bcffd71245b9f2af79e04fd58740f7b4cce50da80a405403c959563d132f2c"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x2A6Ea2aBEf3D7d7A76CBeF3c297eE0eF9a86BBA8",
|
||||
"tx": "0x163b699e8a25073ad1ad45c8a8f9b1348eb0b648d3f4bc6f3f64648e0ad726bf"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x0E3407C9A94effa675471afe7A9D37e687C32141",
|
||||
@@ -95672,17 +95538,10 @@
|
||||
"tx": "0x87b7e454992157e175f824cbd5cbfd068ce890b8603edcb70174bae9b5c4afc8"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x13A01db15250975cE4f7AddF5C20CC1f5056Fc47",
|
||||
"tranche_id": 6,
|
||||
"tx": "0xc4bcffd71245b9f2af79e04fd58740f7b4cce50da80a405403c959563d132f2c"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
},
|
||||
{
|
||||
"address": "0x7b4127D262acC0Ff3dB2D0521d1F1f3b602243C2",
|
||||
@@ -98195,17 +98054,10 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x4eE1C5ED78143f298ae4E5E17e538a99E8512db7",
|
||||
"tranche_id": 6,
|
||||
"tx": "0xcb7b99dc5240cdcaaed2fae06e9fd8172db0387179fe09b5f1e1cefff16c6025"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
},
|
||||
{
|
||||
"address": "0x1dC24e9601e40013a12CB9976a519860c4eDF359",
|
||||
@@ -98247,17 +98099,10 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x01E41ffFBcBC9DDA6E2e9e7291cA8AcCE1AF2091",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x0af2b3703c268eed4532409b52b6fae066207adf80f9dd2fc17b7aacc40f2879"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
},
|
||||
{
|
||||
"address": "0x6EE016F4512C910b401B18087BBAC15412dD97cA",
|
||||
@@ -98591,17 +98436,10 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xac494D6eC2CcA7C9BD1caD0c1D0516F3706c6b7c",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x85a5d2a4faa6490fc25e080f09dc4d9b5fb3857d762042ba2dcbc0f04de41e0c"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
},
|
||||
{
|
||||
"address": "0xa7137DA63B53138A6DCdC9D9a010F42F951F1113",
|
||||
@@ -98643,17 +98481,10 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xa9C1CA1E66CB3063352433843521861844A2Fd33",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x8fad99b8976fff57a099e59351ae96379ec3041e32ccce144727eea29cfffe59"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
},
|
||||
{
|
||||
"address": "0xbCd93996629B0fFA1DfaE74Bb6e107ddB1CE7934",
|
||||
@@ -98680,17 +98511,10 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0xcAEbd70D80D5aB92Ae5A2E1c92F479298826548C",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x7ffbc82e96bb7c796feb548a7ca48a7430a47dae3f2e9de859e6d45ac31a4e6c"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
},
|
||||
{
|
||||
"address": "0x64Aac7Cb63317DE77C331686E0b2dAA41303Adf0",
|
||||
@@ -98769,17 +98593,10 @@
|
||||
"tx": "0x1c2c084e3efafb2ffa09c0b259bd229cce0d6da04dd092d911c7e6136a7ac8a9"
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x2A6Ea2aBEf3D7d7A76CBeF3c297eE0eF9a86BBA8",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x163b699e8a25073ad1ad45c8a8f9b1348eb0b648d3f4bc6f3f64648e0ad726bf"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "250"
|
||||
},
|
||||
{
|
||||
"address": "0x5D84C52FEf44a84298422f0F87147F80145e2043",
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { gql } from 'graphql-request';
|
||||
import { selfDelegate } from '../capsule/self-delegate';
|
||||
import { requestGQL, setGraphQLEndpoint } from '../capsule/request';
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
@@ -21,143 +19,112 @@ export const addValidatorsSelfDelegate = () => {
|
||||
vegaUrl: Cypress.env('VEGA_URL'),
|
||||
faucetUrl: Cypress.env('FAUCET_URL'),
|
||||
};
|
||||
setGraphQLEndpoint(config.vegaUrl);
|
||||
cy.wrap(getStakedByOperator()).as('selfStakeAmount');
|
||||
cy.get('@selfStakeAmount').then((selfStakeAmount) => {
|
||||
if (String(selfStakeAmount) == '0') {
|
||||
// Get node wallet recovery phrases
|
||||
cy.exec('vegacapsule nodes ls --home-path ~/.vegacapsule/testnet/')
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const obj = JSON.parse(result);
|
||||
console.log(obj);
|
||||
cy.writeFile(
|
||||
'./src/fixtures/wallet/node0RecoveryPhrase',
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletRecoveryPhrase
|
||||
);
|
||||
cy.writeFile(
|
||||
'./src/fixtures/wallet/node1RecoveryPhrase',
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletRecoveryPhrase
|
||||
);
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletPublicKey
|
||||
).as('node0PubKey');
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletPublicKey
|
||||
).as('node1PubKey');
|
||||
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletID
|
||||
).as('node0Id');
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletID
|
||||
).as('node1Id');
|
||||
});
|
||||
|
||||
// Import node wallets
|
||||
cy.exec(
|
||||
'vega wallet import -w node0_wallet --recovery-phrase-file ./src/fixtures/wallet/node0RecoveryPhrase -p ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
// Get node wallet recovery phrases
|
||||
cy.exec('vegacapsule nodes ls --home-path ~/.vegacapsule/testnet/')
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const obj = JSON.parse(result);
|
||||
console.log(obj);
|
||||
cy.writeFile(
|
||||
'./src/fixtures/wallet/node0RecoveryPhrase',
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletRecoveryPhrase
|
||||
);
|
||||
cy.exec(
|
||||
'vega wallet import -w node1_wallet --recovery-phrase-file ./src/fixtures/wallet/node1RecoveryPhrase -p ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
cy.writeFile(
|
||||
'./src/fixtures/wallet/node1RecoveryPhrase',
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletRecoveryPhrase
|
||||
);
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletPublicKey
|
||||
).as('node0PubKey');
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletPublicKey
|
||||
).as('node1PubKey');
|
||||
|
||||
// Initialise api token
|
||||
cy.exec(
|
||||
'vega wallet api-token init --home ~/.vegacapsule/testnet/wallet --passphrase-file ./src/fixtures/wallet/passphrase'
|
||||
);
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-0-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletID
|
||||
).as('node0Id');
|
||||
cy.wrap(
|
||||
obj['testnet-nodeset-validators-1-validator'].Vega.NodeWalletInfo
|
||||
.VegaWalletID
|
||||
).as('node1Id');
|
||||
});
|
||||
|
||||
// Generate api tokens for wallets
|
||||
cy.exec(
|
||||
'vega wallet api-token generate --wallet-name node0_wallet --tokens-passphrase-file ./src/fixtures/wallet/passphrase --wallet-passphrase-file ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
)
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const apiToken = result.match('[a-zA-Z0-9]{64}');
|
||||
if (apiToken) {
|
||||
cy.wrap(apiToken[0]).as('node0ApiToken');
|
||||
}
|
||||
});
|
||||
// Import node wallets
|
||||
cy.exec(
|
||||
'vega wallet import -w node0_wallet --recovery-phrase-file ./src/fixtures/wallet/node0RecoveryPhrase -p ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
);
|
||||
cy.exec(
|
||||
'vega wallet import -w node1_wallet --recovery-phrase-file ./src/fixtures/wallet/node1RecoveryPhrase -p ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
);
|
||||
|
||||
cy.exec(
|
||||
'vega wallet api-token generate --wallet-name node1_wallet --tokens-passphrase-file ./src/fixtures/wallet/passphrase --wallet-passphrase-file ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
)
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const apiToken = result.match('[a-zA-Z0-9]{64}');
|
||||
if (apiToken) {
|
||||
cy.wrap(apiToken[0]).as('node1ApiToken');
|
||||
}
|
||||
});
|
||||
// Initialise api token
|
||||
cy.exec(
|
||||
'vega wallet api-token init --home ~/.vegacapsule/testnet/wallet --passphrase-file ./src/fixtures/wallet/passphrase'
|
||||
);
|
||||
|
||||
cy.updateCapsuleMultiSig();
|
||||
cy.highlight('Validators self-delegating');
|
||||
// Generate api tokens for wallets
|
||||
cy.exec(
|
||||
'vega wallet api-token generate --wallet-name node0_wallet --tokens-passphrase-file ./src/fixtures/wallet/passphrase --wallet-passphrase-file ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
)
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const apiToken = result.match('[a-zA-Z0-9]{64}');
|
||||
if (apiToken) {
|
||||
cy.wrap(apiToken[0]).as('node0ApiToken');
|
||||
}
|
||||
});
|
||||
|
||||
// Self delegating Node 0 wallet
|
||||
cy.get('@node0PubKey').then((node0PubKey) => {
|
||||
cy.get('@node0ApiToken').then((node0ApiToken) => {
|
||||
cy.get('@node0Id').then((node0Id) => {
|
||||
cy.wrap(
|
||||
selfDelegate(
|
||||
config,
|
||||
String(node0PubKey),
|
||||
String(node0ApiToken),
|
||||
String(node0Id)
|
||||
),
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
// Self delegating Node 1 wallet
|
||||
cy.get('@node1PubKey').then((node1PubKey) => {
|
||||
cy.get('@node1ApiToken').then((node1ApiToken) => {
|
||||
cy.get('@node1Id').then((node1Id) => {
|
||||
cy.wrap(
|
||||
selfDelegate(
|
||||
config,
|
||||
String(node1PubKey),
|
||||
String(node1ApiToken),
|
||||
String(node1Id)
|
||||
),
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
});
|
||||
});
|
||||
cy.exec(
|
||||
'vega wallet api-token generate --wallet-name node1_wallet --tokens-passphrase-file ./src/fixtures/wallet/passphrase --wallet-passphrase-file ./src/fixtures/wallet/passphrase --home ~/.vegacapsule/testnet/wallet'
|
||||
)
|
||||
.its('stdout')
|
||||
.then((result) => {
|
||||
const apiToken = result.match('[a-zA-Z0-9]{64}');
|
||||
if (apiToken) {
|
||||
cy.wrap(apiToken[0]).as('node1ApiToken');
|
||||
}
|
||||
});
|
||||
|
||||
cy.updateCapsuleMultiSig();
|
||||
cy.highlight('Validators self-delegating');
|
||||
|
||||
// Self delegating Node 0 wallet
|
||||
cy.get('@node0PubKey').then((node0PubKey) => {
|
||||
cy.get('@node0ApiToken').then((node0ApiToken) => {
|
||||
cy.get('@node0Id').then((node0Id) => {
|
||||
cy.wrap(
|
||||
selfDelegate(
|
||||
config,
|
||||
String(node0PubKey),
|
||||
String(node0ApiToken),
|
||||
String(node0Id)
|
||||
),
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
// Self delegating Node 1 wallet
|
||||
cy.get('@node1PubKey').then((node1PubKey) => {
|
||||
cy.get('@node1ApiToken').then((node1ApiToken) => {
|
||||
cy.get('@node1Id').then((node1Id) => {
|
||||
cy.wrap(
|
||||
selfDelegate(
|
||||
config,
|
||||
String(node1PubKey),
|
||||
String(node1ApiToken),
|
||||
String(node1Id)
|
||||
),
|
||||
{ timeout: 60000 }
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
async function getStakedByOperator() {
|
||||
const query = gql`
|
||||
query ExplorerNodes {
|
||||
nodesConnection {
|
||||
edges {
|
||||
node {
|
||||
stakedByOperator
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const res = await requestGQL<{
|
||||
nodesConnection: {
|
||||
edges: Array<{
|
||||
node: {
|
||||
stakedByOperator: string;
|
||||
};
|
||||
}>;
|
||||
};
|
||||
}>(query);
|
||||
|
||||
return res.nodesConnection.edges[0].node.stakedByOperator;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ethers } from 'ethers';
|
||||
import { hexlify, toUtf8Bytes } from 'ethers/lib/utils';
|
||||
import { hexlify } from 'ethers/lib/utils';
|
||||
import abi from '../abis/claim_abi.json';
|
||||
import { calcGasBuffer } from '../utils';
|
||||
|
||||
@@ -70,7 +70,7 @@ export class Claim {
|
||||
tranche,
|
||||
expiry,
|
||||
},
|
||||
hexlify(toUtf8Bytes(country)),
|
||||
hexlify(country),
|
||||
target,
|
||||
].filter(Boolean);
|
||||
const res = await this.contract.estimateGas[method](...args);
|
||||
@@ -110,9 +110,7 @@ export class Claim {
|
||||
* @return {Promise<boolean>}
|
||||
*/
|
||||
async isCountryBlocked(country: string): Promise<boolean> {
|
||||
const isAllowed = await this.contract.allowed_countries(
|
||||
hexlify(toUtf8Bytes(country))
|
||||
);
|
||||
const isAllowed = await this.contract.allowed_countries(hexlify(country));
|
||||
return !isAllowed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user