Skip to content

Commit

Permalink
feat(sdk-coin-zeta): zeta sdk init along with testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
DinshawKothari committed Jul 26, 2023
1 parent bd9cd0f commit 5f39bf6
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
118 changes: 59 additions & 59 deletions modules/sdk-coin-zeta/test/resources/zeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,34 @@ export const TEST_SEND_TX = {
};

export const TEST_DELEGATE_TX = {
hash: 'CFE83BCC9BDA9E4E51E3E03F772B7CAEFEE9E74E00F223B26C5AB3A8B7F3B44A',
signature: 'p5UoOHBw7mWPt4RA5ZNc9gOjcbIlYKx3/wz/cnHeTXVawu/kJ0Fr0TpfrTaZWvmstGaAUk1k5d5sM4b5ZIgIAw==',
pubKey: 'AhvHHUQYuVrRbuUbrfX8NDqsQ/9swswreoiyzcg8L9bw',
privateKey: 'hrLO1X8Z5PVyDlBji5HjgrETVatKBmJhTZjg9Oq7b18=',
hash: '7CE96381A3BD78EE84D671CB360C2D616ADB4E3AAA5615BA054AC39B94E83EF6',
signature: '879wbHPIcXpxPFAeMOUc1gNVeH+CbAftTcPk94Rz6mBiJo1QVRk7BnghHfaGIQ1tKSr8kc3c2A6FHcsJK9Iw+w==',
pubKey: 'A+E+fjbiCvXkVwNfcfMyuV5xMQelOaHsgKt0XklolaiZ',
privateKey: 'w7gsHxeGjJBwHNRE8fUwSJHYPrimZqngjc8hNR9vTLQ=',
signedTxBase64:
'CpgBCpUBCiMvY29zbW9zLnN0YWtpbmcudjFiZXRhMS5Nc2dEZWxlZ2F0ZRJuCippbmoxNXB6NmZxNjUyY21lMGd4NmRkMno5d3R6YTNyd216OWo0eXdrc2QSMWluanZhbG9wZXIxa2s1MjNyc205cGV5NzQwY3g0cGxhbHA0MDAwOW5jczB3cmNoZmUaDQoEdWluahIFMTAwMDAScApQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohAhvHHUQYuVrRbuUbrfX8NDqsQ/9swswreoiyzcg8L9bwEgQKAggBGCASHAoWCgNpbmoSDzEwMDAwMDAwMDAwMDAwMBDAmgwaQKeVKDhwcO5lj7eEQOWTXPYDo3GyJWCsd/8M/3Jx3k11WsLv5CdBa9E6X602mVr5rLRmgFJNZOXebDOG+WSICAM=',
delegator: 'inj15pz6fq652cme0gx6dd2z9wtza3rwmz9j4ywksd',
validator: 'injvaloper1kk523rsm9pey740cx4plalp40009ncs0wrchfe',
chainId: 'injective-888',
accountNumber: 13079,
sequence: 32,
'CpsBCpgBCiMvY29zbW9zLnN0YWtpbmcudjFiZXRhMS5Nc2dEZWxlZ2F0ZRJxCit6ZXRhMTJraHhtbGt5ejloZmx1djJkdGQ0dDc0bGYzaHJtYWt5MHNxMGUyEjJ6ZXRhdmFsb3BlcjFwcHRmaG55ajM3cW4wbmZ1aG11N201c3N5NXg2dGQ4aG1jY3B6bBoOCgVhemV0YRIFMTAwMDAScgpQCkYKHy9jb3Ntb3MuY3J5cHRvLnNlY3AyNTZrMS5QdWJLZXkSIwohA+E+fjbiCvXkVwNfcfMyuV5xMQelOaHsgKt0XklolaiZEgQKAggBGAYSHgoYCgVhemV0YRIPMTAwMDAwMDAwMDAwMDAwEMCaDBpA879wbHPIcXpxPFAeMOUc1gNVeH+CbAftTcPk94Rz6mBiJo1QVRk7BnghHfaGIQ1tKSr8kc3c2A6FHcsJK9Iw+w==',
delegator: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
validator: 'zetavaloper1pptfhnyj37qn0nfuhmu7m5ssy5x6td8hmccpzl',
chainId: 'athens_7001-1',
accountNumber: 258033,
sequence: 6,
sendAmount: '10000',
feeAmount: '100000000000000',
sendMessage: {
typeUrl: '/cosmos.staking.v1beta1.MsgDelegate',
value: {
delegatorAddress: 'inj15pz6fq652cme0gx6dd2z9wtza3rwmz9j4ywksd',
validatorAddress: 'injvaloper1kk523rsm9pey740cx4plalp40009ncs0wrchfe',
delegatorAddress: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
validatorAddress: 'zetavaloper1pptfhnyj37qn0nfuhmu7m5ssy5x6td8hmccpzl',
amount: {
denom: 'uinj',
denom: 'azeta',
amount: '10000',
},
},
},
gasBudget: {
amount: [
{
denom: 'inj',
denom: 'azeta',
amount: '100000000000000',
},
],
Expand All @@ -83,34 +83,34 @@ export const TEST_DELEGATE_TX = {
};

export const TEST_UNDELEGATE_TX = {
hash: '2B373B66F359368527BDD9E40D716B3D66B46EDA048164BE00E655109A3FA374',
signature: '750kQqYHaQ22TUCX2O1TaGKiSeetFlUl7B4J3ZplohZrfRylW4K/MGNh1mQ7oisUD065o4howrvn0DcMtxWIdQ==',
pubKey: 'AhvHHUQYuVrRbuUbrfX8NDqsQ/9swswreoiyzcg8L9bw',
privateKey: 'hrLO1X8Z5PVyDlBji5HjgrETVatKBmJhTZjg9Oq7b18=',
hash: 'A7FCEA1B657CD3CA0BF7E03CB6B3279D1B737CBE1B8449E920A23453DACE2B1A',
signature: 'K69sqHfrCe32lsh18jRZ1ZRlr5E5XqdUS1zI3AIfQrRCiPrp/cTVbkyp1HGVr+geoE04CLRDuT7iLHjAwQNlwg==',
pubKey: 'A+E+fjbiCvXkVwNfcfMyuV5xMQelOaHsgKt0XklolaiZ',
privateKey: 'w7gsHxeGjJBwHNRE8fUwSJHYPrimZqngjc8hNR9vTLQ=',
signedTxBase64:
'CpoBCpcBCiUvY29zbW9zLnN0YWtpbmcudjFiZXRhMS5Nc2dVbmRlbGVnYXRlEm4KKmluajE1cHo2ZnE2NTJjbWUwZ3g2ZGQyejl3dHphM3J3bXo5ajR5d2tzZBIxaW5qdmFsb3BlcjFrazUyM3JzbTlwZXk3NDBjeDRwbGFscDQwMDA5bmNzMHdyY2hmZRoNCgR1aW5qEgUxMDAwMBJwClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiECG8cdRBi5WtFu5Rut9fw0OqxD/2zCzCt6iLLNyDwv1vASBAoCCAEYIRIcChYKA2luahIPMTAwMDAwMDAwMDAwMDAwEMCaDBpA750kQqYHaQ22TUCX2O1TaGKiSeetFlUl7B4J3ZplohZrfRylW4K/MGNh1mQ7oisUD065o4howrvn0DcMtxWIdQ==',
delegator: 'inj15pz6fq652cme0gx6dd2z9wtza3rwmz9j4ywksd',
validator: 'injvaloper1kk523rsm9pey740cx4plalp40009ncs0wrchfe',
chainId: 'injective-888',
accountNumber: 13079,
sequence: 33,
'Cp0BCpoBCiUvY29zbW9zLnN0YWtpbmcudjFiZXRhMS5Nc2dVbmRlbGVnYXRlEnEKK3pldGExMmtoeG1sa3l6OWhmbHV2MmR0ZDR0NzRsZjNocm1ha3kwc3EwZTISMnpldGF2YWxvcGVyMXBwdGZobnlqMzdxbjBuZnVobXU3bTVzc3k1eDZ0ZDhobWNjcHpsGg4KBWF6ZXRhEgUxMDAwMBJyClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED4T5+NuIK9eRXA19x8zK5XnExB6U5oeyAq3ReSWiVqJkSBAoCCAEYBxIeChgKBWF6ZXRhEg8xMDAwMDAwMDAwMDAwMDAQwJoMGkArr2yod+sJ7faWyHXyNFnVlGWvkTlep1RLXMjcAh9CtEKI+un9xNVuTKnUcZWv6B6gTTgItEO5PuIseMDBA2XC',
delegator: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
validator: 'zetavaloper1pptfhnyj37qn0nfuhmu7m5ssy5x6td8hmccpzl',
chainId: 'athens_7001-1',
accountNumber: 258033,
sequence: 7,
sendAmount: '10000',
feeAmount: '100000000000000',
sendMessage: {
typeUrl: '/cosmos.staking.v1beta1.MsgUndelegate',
value: {
delegatorAddress: 'inj15pz6fq652cme0gx6dd2z9wtza3rwmz9j4ywksd',
validatorAddress: 'injvaloper1kk523rsm9pey740cx4plalp40009ncs0wrchfe',
delegatorAddress: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
validatorAddress: 'zetavaloper1pptfhnyj37qn0nfuhmu7m5ssy5x6td8hmccpzl',
amount: {
denom: 'uinj',
denom: 'azeta',
amount: '10000',
},
},
},
gasBudget: {
amount: [
{
denom: 'inj',
denom: 'azeta',
amount: '100000000000000',
},
],
Expand All @@ -119,34 +119,34 @@ export const TEST_UNDELEGATE_TX = {
};

export const TEST_WITHDRAW_REWARDS_TX = {
hash: '55FBC9C1AC8674FFFAB1A80DAF928BC344DCBFE12876844C9E5FF08CD3FDE2F6',
signature: '3sAfy+B22YFY0iLLrJCBHvKYlYwtaUARBswcDUCfnP4mZPwkS7vI9CEEyg23AYahndYHxQG0W1IbSHeiNf909Q==',
pubKey: 'AhvHHUQYuVrRbuUbrfX8NDqsQ/9swswreoiyzcg8L9bw',
privateKey: 'hrLO1X8Z5PVyDlBji5HjgrETVatKBmJhTZjg9Oq7b18=',
hash: 'C072433DD1B9D1A5A0C90E6C65EF0E034FBEA73B3C3E9ADC798D23049A058416',
signature: 'gLE/KcGKXcpdZ9Lo5sjcwpaNOUESLgOBDtR46IhzIAtOLaxJQNuMW4uKYENLQr4So3dJLQgaArDbVsZygxJ3fg==',
pubKey: 'A+E+fjbiCvXkVwNfcfMyuV5xMQelOaHsgKt0XklolaiZ',
privateKey: 'w7gsHxeGjJBwHNRE8fUwSJHYPrimZqngjc8hNR9vTLQ=',
signedTxBase64:
'Cp0BCpoBCjcvY29zbW9zLmRpc3RyaWJ1dGlvbi52MWJldGExLk1zZ1dpdGhkcmF3RGVsZWdhdG9yUmV3YXJkEl8KKmluajE1cHo2ZnE2NTJjbWUwZ3g2ZGQyejl3dHphM3J3bXo5ajR5d2tzZBIxaW5qdmFsb3BlcjFrazUyM3JzbTlwZXk3NDBjeDRwbGFscDQwMDA5bmNzMHdyY2hmZRJwClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiECG8cdRBi5WtFu5Rut9fw0OqxD/2zCzCt6iLLNyDwv1vASBAoCCAEYIhIcChYKA2luahIPMTAwMDAwMDAwMDAwMDAwEMCaDBpA3sAfy+B22YFY0iLLrJCBHvKYlYwtaUARBswcDUCfnP4mZPwkS7vI9CEEyg23AYahndYHxQG0W1IbSHeiNf909Q==',
delegator: 'inj15pz6fq652cme0gx6dd2z9wtza3rwmz9j4ywksd',
validator: 'injvaloper1kk523rsm9pey740cx4plalp40009ncs0wrchfe',
chainId: 'injective-888',
accountNumber: 13079,
sequence: 34,
'Cp8BCpwBCjcvY29zbW9zLmRpc3RyaWJ1dGlvbi52MWJldGExLk1zZ1dpdGhkcmF3RGVsZWdhdG9yUmV3YXJkEmEKK3pldGExMmtoeG1sa3l6OWhmbHV2MmR0ZDR0NzRsZjNocm1ha3kwc3EwZTISMnpldGF2YWxvcGVyMXBwdGZobnlqMzdxbjBuZnVobXU3bTVzc3k1eDZ0ZDhobWNjcHpsEnIKUApGCh8vY29zbW9zLmNyeXB0by5zZWNwMjU2azEuUHViS2V5EiMKIQPhPn424gr15FcDX3HzMrlecTEHpTmh7ICrdF5JaJWomRIECgIIARgIEh4KGAoFYXpldGESDzEwMDAwMDAwMDAwMDAwMBDAmgwaQICxPynBil3KXWfS6ObI3MKWjTlBEi4DgQ7UeOiIcyALTi2sSUDbjFuLimBDS0K+EqN3SS0IGgKw21bGcoMSd34=',
delegator: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
validator: 'zetavaloper1pptfhnyj37qn0nfuhmu7m5ssy5x6td8hmccpzl',
chainId: 'athens_7001-1',
accountNumber: 258033,
sequence: 8,
sendAmount: '10000',
feeAmount: '100000000000000',
sendMessage: {
typeUrl: '/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward',
value: {
delegatorAddress: 'inj15pz6fq652cme0gx6dd2z9wtza3rwmz9j4ywksd',
validatorAddress: 'injvaloper1kk523rsm9pey740cx4plalp40009ncs0wrchfe',
delegatorAddress: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
validatorAddress: 'zetavaloper1pptfhnyj37qn0nfuhmu7m5ssy5x6td8hmccpzl',
amount: {
denom: 'uinj',
denom: 'azeta',
amount: '10000',
},
},
},
gasBudget: {
amount: [
{
denom: 'inj',
denom: 'azeta',
amount: '100000000000000',
},
],
Expand All @@ -155,37 +155,37 @@ export const TEST_WITHDRAW_REWARDS_TX = {
};

export const TEST_TX_WITH_MEMO = {
hash: 'A9696BBAFE896A81DC4B339F3419361ECFE8EF6B6792FC2EA4F081962DF2B138',
signature: 'QzTMK2mw2/tVw2t4En+2V/C5T2Iy/41tJ216GLJPWCgd7USBdDRsXrROwbGoxYi71hMvs58/DEAUaM7f8uGk0w==',
pubKey: 'AhvHHUQYuVrRbuUbrfX8NDqsQ/9swswreoiyzcg8L9bw',
privateKey: 'hrLO1X8Z5PVyDlBji5HjgrETVatKBmJhTZjg9Oq7b18=',
hash: 'ED734BF9D37C4593DE3D535EDC0DB551E6CA250B0F6663AEA5C35989830D4D4A',
signature: '7UgsEUhDIyhVCkuVulTyTdwdP5qTWPqEq4zt3JjtP2MuQVsYktjs96rQh1uBFI2qv7DL8w7hy+0pWYpP3pFthg==',
pubKey: 'A+E+fjbiCvXkVwNfcfMyuV5xMQelOaHsgKt0XklolaiZ',
privateKey: 'w7gsHxeGjJBwHNRE8fUwSJHYPrimZqngjc8hNR9vTLQ=',
signedTxBase64:
'Co4BCogBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmgKKmluajE1cHo2ZnE2NTJjbWUwZ3g2ZGQyejl3dHphM3J3bXo5ajR5d2tzZBIqaW5qMWRybjN2emc2eGVwNjNwdGF4c3loajZweTVhajhmeTNkNDMwM3AwGg4KBHVpbmoSBjEwMDAwMBIBNRJwClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiECG8cdRBi5WtFu5Rut9fw0OqxD/2zCzCt6iLLNyDwv1vASBAoCCAEYHxIcChYKA2luahIPMTAwMDAwMDAwMDAwMDAwEMCaDBpAQzTMK2mw2/tVw2t4En+2V/C5T2Iy/41tJ216GLJPWCgd7USBdDRsXrROwbGoxYi71hMvs58/DEAUaM7f8uGk0w==',
from: 'inj15pz6fq652cme0gx6dd2z9wtza3rwmz9j4ywksd',
to: 'inj1drn3vzg6xep63ptaxsyhj6py5aj8fy3d4303p0',
chainId: 'injective-888',
accountNumber: 13079,
sequence: 31,
'CpEBCosBChwvY29zbW9zLmJhbmsudjFiZXRhMS5Nc2dTZW5kEmsKK3pldGExMmtoeG1sa3l6OWhmbHV2MmR0ZDR0NzRsZjNocm1ha3kwc3EwZTISK3pldGExa3RycjRqdTNhMmx1eHBjZm12NDR4cnBhNGx3eDR1ZnNhMzh3dDgaDwoFYXpldGESBjEwMDAwMBIBNRJyClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiED4T5+NuIK9eRXA19x8zK5XnExB6U5oeyAq3ReSWiVqJkSBAoCCAEYBRIeChgKBWF6ZXRhEg8xMDAwMDAwMDAwMDAwMDAQwJoMGkDtSCwRSEMjKFUKS5W6VPJN3B0/mpNY+oSrjO3cmO0/Yy5BWxiS2Oz3qtCHW4EUjaq/sMvzDuHL7SlZik/ekW2G',
from: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
to: 'zeta1ktrr4ju3a2luxpcfmv44xrpa4lwx4ufsa38wt8',
chainId: 'athens_7001-1',
accountNumber: 258033,
sequence: 5,
sendAmount: '100000',
feeAmount: '100000000000000',
sendMessage: {
typeUrl: '/cosmos.bank.v1beta1.MsgSend',
value: {
amount: [
{
denom: 'uinj',
denom: 'azeta',
amount: '100000',
},
],
toAddress: 'inj1drn3vzg6xep63ptaxsyhj6py5aj8fy3d4303p0',
fromAddress: 'inj15pz6fq652cme0gx6dd2z9wtza3rwmz9j4ywksd',
toAddress: 'zeta1ktrr4ju3a2luxpcfmv44xrpa4lwx4ufsa38wt8',
fromAddress: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
},
},
memo: '5',
gasBudget: {
amount: [
{
denom: 'inj',
denom: 'azeta',
amount: '100000000000000',
},
],
Expand All @@ -196,12 +196,12 @@ export const TEST_TX_WITH_MEMO = {
export const address = {
address1: 'zeta18t3y6mzljydmqzrlfrnsfvwtdupww0dexegtuu',
address2: 'zeta12khxmlkyz9hfluv2dtd4t74lf3hrmaky0sq0e2',
address3: 'zeta1ktrr4ju3a2luxpcfmv44xrpa4lwx4ufsa38wt8',
address3: 'zxta18t3y6mzljydmqzrlfrnsfvwtdupww0dexegtuu',
address4: 'zeta1yt84ujwncxjy63rjceh7dcakx09cdz6yrst5hq',
validatorAddress1: 'zetavaloper1pptfhnyj37qn0nfuhmu7m5ssy5x6td8hmccpzl',
validatorAddress2: 'zetavaloper1p3emgemv8q0fmtw70kfzwecmcvyd9ztqlzudwn',
validatorAddress3: 'zetavaloper1ztq4hqq29ea7pxa0gq4j72a0qakj0nk6se8uxx',
validatorAddress4: 'zetavaloper1ylc3m77tvm7wkrc7awn2tlqp4zfwvgnpdywp4y',
validatorAddress3: 'zxtavaloper1ztq4hqq29ea7pxa0gq4j72a0qakj0nk6se8uxx',
validatorAddress4: 'zetavalopr1xylc3m77tvm7wkrc7awn2tlqp4zfwvgnpdywp4y',
noMemoIdAddress: 'zeta18t3y6mzljydmqzrlfrnsfvwtdupww0dexegtuu',
validMemoIdAddress: 'zeta18t3y6mzljydmqzrlfrnsfvwtdupww0dexegtuu?memoId=2',
invalidMemoIdAddress: 'zeta18t3y6mzljydmqzrlfrnsfvwtdupww0dexegtuu?memoId=xyz',
Expand Down
6 changes: 3 additions & 3 deletions modules/sdk-coin-zeta/test/unit/zeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BitGoAPI } from '@bitgo/sdk-api';
import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test';
import BigNumber from 'bignumber.js';
import sinon from 'sinon';
import { Zeta, Tzeta } from '../../src';
import { Tzeta, Zeta } from '../../src';
import utils from '../../src/lib/utils';
import {
TEST_DELEGATE_TX,
Expand Down Expand Up @@ -67,9 +67,9 @@ describe('Zeta', function () {

it('should validate wallet receive address', async function () {
const receiveAddress = {
address: 'inj1vftzm2nnlt0x8z9gq2hgxxywlk79m8k7k3ljgk?memoId=7',
address: 'zeta1ktrr4ju3a2luxpcfmv44xrpa4lwx4ufsa38wt8?memoId=7',
coinSpecific: {
rootAddress: 'inj1vftzm2nnlt0x8z9gq2hgxxywlk79m8k7k3ljgk',
rootAddress: 'zeta1ktrr4ju3a2luxpcfmv44xrpa4lwx4ufsa38wt8',
memoID: '7',
},
};
Expand Down

0 comments on commit 5f39bf6

Please sign in to comment.