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

chore(sdk-coin-bera): add bera Cartio testnet #5400

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/sdk-coin-bera/src/lib/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { coins, EthereumNetwork } from '@bitgo/statics';

export const testnetCommon = EthereumCommon.custom(
{
name: 'Berachain bArtio',
name: 'Berachain cArtio',
networkId: (coins.get('tbera').network as EthereumNetwork).chainId,
chainId: (coins.get('tbera').network as EthereumNetwork).chainId,
},
Expand Down
18 changes: 8 additions & 10 deletions modules/sdk-coin-bera/test/resources.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/sdk-coin-bera/test/unit/bera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('Bera', function () {
bera.should.be.an.instanceof(Bera);
bera.getChain().should.equal('bera');
bera.getFamily().should.equal('bera');
bera.getFullName().should.equal('berachain');
bera.getFullName().should.equal('Bera');
bera.getBaseFactor().should.equal(1e18);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Bera transaction builder send', () => {
txBuilder.sign({ key: testData.PRIVATE_KEY_1 });
const tx = await txBuilder.build();

should.equal(tx.toJson().chainId, 0x138d4);
should.equal(tx.toJson().chainId, 0x13880);
should.equal(tx.toBroadcastFormat(), testData.SEND_TX_BROADCAST_LEGACY);
should.equal(tx.signature.length, 2);
should.equal(tx.inputs.length, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Bera wallet initialization', function () {
txJson.gasLimit.should.equal('6800000');
txJson.gasPrice.should.equal('10000000000');
should.equal(txJson.nonce, 1);
should.equal(txJson.chainId, '0x138d4');
should.equal(txJson.chainId, '0x13880');
should.equal(tx.toBroadcastFormat(), testData.TX_BROADCAST);
});

Expand All @@ -44,7 +44,7 @@ describe('Bera wallet initialization', function () {
newTxBuilder.from(testData.TX_BROADCAST);
const newTx = await newTxBuilder.build();
should.equal(newTx.toBroadcastFormat(), testData.TX_BROADCAST);
should.equal(newTx.id, '0x79640186741285e6f3a325990cff9fc8475f5e35c8b2e1ee41e21be59897b905');
should.equal(newTx.id, '0x163072a22e955eda136e14ca223b83cd911808d9e42f1f06c0f747466a025a72');
const txJson = newTx.toJson();
should.exist(txJson.v);
should.exist(txJson.r);
Expand All @@ -66,7 +66,7 @@ describe('Bera wallet initialization', function () {
txJson.gasLimit.should.equal('6800000');
txJson.gasPrice.should.equal('10000000000');
should.equal(txJson.nonce, 0);
should.equal(txJson.chainId, '0x138d4');
should.equal(txJson.chainId, '0x13880');
});

it('an unsigned init transaction from serialized with 0-prefixed address', async () => {
Expand Down Expand Up @@ -103,7 +103,7 @@ describe('Bera wallet initialization', function () {
txBuilder.owner('0x78caeb4527170e52f54d936e4eef6f83250e01bb');
txBuilder.owner('0xb1938215967408fff7c59c77ae5e5283b55c8e26');
const tx = await txBuilder.build();
should.equal(tx.toJson().v, '0x0271cb');
should.equal(tx.toJson().v, '0x027123');
});
});
});
2 changes: 1 addition & 1 deletion modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,7 @@ export const coins = CoinMap.fromCoins([
account(
'ac3c225e-55a9-4236-b907-a4cccc30a2fd',
'bera',
'berachain',
'Bera',
Networks.main.bera,
18,
UnderlyingAsset.BERA,
Expand Down
18 changes: 8 additions & 10 deletions modules/statics/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1055,16 +1055,14 @@ class Berachain extends Mainnet implements EthereumNetwork {
class BerachainTestnet extends Testnet implements EthereumNetwork {
name = 'BerachainTestnet';
family = CoinFamily.BERA;
explorerUrl = 'https://bartio.beratrail.io/tx/';
accountExplorerUrl = 'https://bartio.beratrail.io/address/';
chainId = 80084;
nativeCoinOperationHashPrefix = '80084';
tokenOperationHashPrefix = '80084-ERC20';
forwarderFactoryAddress = '0xccadf4198de4957d07d80673684ed19310579fc4';
forwarderImplementationAddress = '0xc75fb848eb0bb04e3faedbee0fc8144e8d62b83d';
walletFactoryAddress = '0x6e4a83086c6dd9fbce203c1ebb69eda1aba872d7';
walletImplementationAddress = '0xb8d48d310818b15a6960f9afbef49dc96d2bd2d3';
batcherContractAddress = '0xf499549720116c3dEA867D4fC279C43aCA172712';
explorerUrl = 'https://80000.testnet.routescan.io/tx/';
accountExplorerUrl = 'https://80000.testnet.routescan.io/address/';
chainId = 80000;
nativeCoinOperationHashPrefix = '80000';
tokenOperationHashPrefix = '80000-ERC20';
batcherContractAddress = '0xedf1a0016d9c41d2ad0c275e1ba708361a90c0d1';
forwarderFactoryAddress = '0x37996e762fa8b671869740c79eb33f625b3bf92a';
forwarderImplementationAddress = '0xd5fe1c1f216b775dfd30638fa7164d41321ef79b';
}

class Oas extends Mainnet implements EthereumNetwork {
Expand Down
Loading