Skip to content

Commit

Permalink
test(sdk-coin-arbeth): add testcases for arbeth
Browse files Browse the repository at this point in the history
  • Loading branch information
gianchandania committed Nov 9, 2023
1 parent 1a75e88 commit d0f5783
Show file tree
Hide file tree
Showing 5 changed files with 774 additions and 8 deletions.
17 changes: 16 additions & 1 deletion modules/sdk-coin-arbeth/src/lib/transferBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import { TransferBuilder as EthTransferBuilder } from '@bitgo/abstract-eth';

export class TransferBuilder extends EthTransferBuilder {
/** @inheritdoc */
/**
* Get the prefix used in generating an operation hash for sending native coins
* See https://github.com/BitGo/eth-multisig-v4/blob/master/contracts/coins/ArbethWalletSimple.sol
*
* @returns the string prefix
*/
protected getNativeOperationHashPrefix(): string {
return 'ARBETH';
}

/**
* Get the prefix used in generating an operation hash for sending tokens
* See https://github.com/BitGo/eth-multisig-v4/blob/master/contracts/coins/ArbethWalletSimple.sol
*
* @returns the string prefix
*/
protected getTokenOperationHashPrefix(): string {
return 'ARBETH-ERC20';
}
}
4 changes: 4 additions & 0 deletions modules/sdk-coin-arbeth/src/register.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { BitGoBase } from '@bitgo/sdk-core';
import { Arbeth } from './arbeth';
import { Tarbeth } from './tarbeth';
import { ArbethToken } from './arbethToken';

export const register = (sdk: BitGoBase): void => {
sdk.register('arbeth', Arbeth.createInstance);
sdk.register('tarbeth', Tarbeth.createInstance);
ArbethToken.createTokenConstructors().forEach(({ name, coinConstructor }) => {
sdk.register(name, coinConstructor);
});
};
7 changes: 7 additions & 0 deletions modules/sdk-coin-arbeth/test/getBuilder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { BaseBuilder } from '@bitgo/sdk-core';
import { coins } from '@bitgo/statics';
import { TransactionBuilder } from '../src';

export function getBuilder(coinName: string): BaseBuilder {
return new TransactionBuilder(coins.get(coinName));
}
Loading

0 comments on commit d0f5783

Please sign in to comment.